Date: Thu, 8 Jan 1998 10:23:04 +0100 (CET)
From: Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>
To: Linux/m68k <linux-m68k@lists.linux-m68k.org>
Subject: L68K: Frame buffer device fixes and clean ups
Sender: owner-linux-m68k@phil.uni-sb.de


Frame buffer/console fixes and clean ups:

  - add CONFIG_ABSTRACT_CONSOLE to Configure.help
  - replaced int fbidx by struct fb_info *info (see below)
  - experimental support for CyberVision 64/3D (by André Heynatz)
  - experimental Mac video support (by Michael Schmitz, Alan Cox, Randy Thelen)
  - support for new packed pixel color depths: cfb2, cfb4, cfb32
  - 6x11 font (for Mac)
  - frame buffer device for ATI on PPC (to be merged with mach64fb)
  - fixed the colormap bug (reported by Frank Neumann)
  - make fbcon-* drivers 64-bit and endianness clean: afb, cfb8, cfb16, ilbm,
    mach64, cyber, retz3 (by Peter De Schrijver and me)
  - use correct putc and putcs routines (i.e. copied from cfb8) for
    fbcon-{cyber,retz3

Note: tested on amifb only. Please test on other platforms.

And these aren't that important for you:
  - offb and atyfb are backwards compatible with the Xpmac X server to speed
    up the transition (PPC)
  - offb should support multiple boards now (untested) (PPC)
  - tgafb: added support for 32 bpp (untested) (AXP)
  - vgacon: typo fix (ia32/AXP (tested) and others (untested))

*below*

All frame buffer operations now pass a struct fb_info *info instead of int
fbidx. This allows for one driver that supports multiple boards of the same
type. The idea is that you can put board specific information after the normal
struct fb_info entries (in C++ this is called inheritance). Offb should be the
first frame buffer device that actually supports this (still untested). Franky,
offb is the place to look.

*end-of-below*


I hear you thinking: what the hell is fbgen.c? Well you'll notice that the code
of fbgen.c is also present in about any current frame buffer device (with some
minor changes, e.g. different xxxfb_par structs). I think we can clean up a lot
of duplicate error prone and difficult to maintain code by using the `generic'
routines from fbgen. To do this, fbgen needs to know the size of the `par'
struct and some pointers to hardware specific operations (modeled after Roman's
fb_hwswitch). Where to store this information? Well, after the normal fb_info
entries. And you can still put board specific stuff after the fbgen stuff
(again, C++ inheritance). So my next move will be to use as much fbgen code as
possible. The necessary definitions are already present in <linux/fb.h> (struct
fb_info_gen).


I'm also thinking of moving the fill in of the struct display_switch from fbcon
to the frame buffer device itself. That way we can keep the accelerated console
operations together with the frame buffer device it belongs too, and fbcon
doesn't have to be that smart anymore.  Generic software operations
(afb/ilbm/cfb*/iplan2p?) should be linked in the kernel (no more module support
for them), so they are always available. Most accelerated drivers rely on e.g.
software cfb for blitting characters, and there's no need to duplicate e.g.
cfb8_putc in all accelerated drivers, a function pointer to the real cfb8_putc
is sufficient.


The frame buffer device also could fill in_two_ copies of struct
display_switch: one accelerated and one unaccelerated. The unaccelerated
version should be used when the console is put in `graphics mode' (by e.g. the
X server) to prevent text console acceleration from disturbing e.g. X
acceleration. And if we forward the `switch to text/graphics ioctl' to the
frame buffer device, it could even provide a real text mode on boards that are
capable of this: accelerated display_switch points to VGA text operations (in
`real text mode'), while unaccelerated display_switch points to unaccelerated
graphics routines (in `graphics mode').


As usual: let's comment and discuss!


FYI: the new console is now known to work on

  - m68k: frame buffer devices, gspcon for Jes
  - ia32: VGA text mode (vgacon)
  - PPC: frame buffer devices (offb and atyfb)
  - AXP: VGA text mode (vgacon) and frame buffer device (tgafb)

SPARC is the major missing port. MIPS shouldn't be a real problem (according to
Ralf Baechle's comments abouts the new console scheme).

diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/Documentation/Configure.help m68k-2.1.72/Documentation/Configure.help
--- m68k-2.1.72-status/Documentation/Configure.help	Mon Dec 22 21:16:19 1997
+++ m68k-2.1.72/Documentation/Configure.help	Sat Jan  3 00:08:21 1998
@@ -6962,6 +6962,13 @@
   Support for BT848 based frame grabber/overlay boards. This includes the 
   Miro, Hauppauge and STB boards.
 
+Unified console driver (EXPERIMENTAL)
+CONFIG_ABSTRACT_CONSOLE
+  Say Y if you want to use the unified console driver that supports all kinds
+  of consoles: VGA text, frame buffer based graphics, ...
+  Please read http://www.cs.kuleuven.ac.be/~geert/Console/ first before saying
+  Y here. Normal users say N.
+
 # need an empty line after last entry, for sed script in Configure.
 
 #
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/char/fbmem.c m68k-2.1.72/drivers/char/fbmem.c
--- m68k-2.1.72-status/drivers/char/fbmem.c	Wed Dec 17 23:55:14 1997
+++ m68k-2.1.72/drivers/char/fbmem.c	Mon Jan  5 19:30:37 1998
@@ -54,6 +54,9 @@
 extern unsigned long vfb_init(unsigned long mem_start);
 extern void vfb_setup(char *options, int *ints);
 extern unsigned long offb_init(unsigned long mem_start);
+extern void offb_setup(char *options, int *ints);
+extern unsigned long atyfb_init(unsigned long mem_start);
+extern void atyfb_setup(char *options, int *ints);
 extern unsigned long dnfb_init(unsigned long mem_start);
 extern unsigned long mach64fb_init(unsigned long mem_start);
 extern void mach64fb_setup(char *options, int *ints);
@@ -84,7 +87,10 @@
 	{ "vfb", vfb_init, vfb_setup },
 #endif
 #ifdef CONFIG_FB_OPEN_FIRMWARE
-	{ "offb", offb_init, NULL },
+	{ "offb", offb_init, offb_setup },
+#endif
+#ifdef CONFIG_FB_ATY
+	{ "atyfb", atyfb_init, atyfb_setup },
 #endif
 #ifdef CONFIG_APOLLO
 	{ "apollo", dnfb_init, NULL },
@@ -153,7 +159,8 @@
 	unsigned long p = *ppos;
 	struct inode *inode = file->f_dentry->d_inode;
 	int fbidx = GET_FB_IDX(inode->i_rdev);
-	struct fb_ops *fb = registered_fb[fbidx]->fbops;
+	struct fb_info *info = registered_fb[fbidx];
+	struct fb_ops *fb = info->fbops;
 	struct fb_fix_screeninfo fix;
 	char *base_addr;
 	ssize_t copy_size;
@@ -161,7 +168,7 @@
 	if (! fb)
 		return -ENODEV;
 
-	fb->fb_get_fix(&fix,PROC_CONSOLE(), fbidx);
+	fb->fb_get_fix(&fix,PROC_CONSOLE(), info);
 	base_addr=(char *) fix.smem_start;
 	copy_size=(count + p <= fix.smem_len ? count : fix.smem_len - p);
 	copy_to_user(buf, base_addr+p, copy_size);
@@ -175,14 +182,15 @@
 	unsigned long p = *ppos;
 	struct inode *inode = file->f_dentry->d_inode;
 	int fbidx = GET_FB_IDX(inode->i_rdev);
-	struct fb_ops *fb = registered_fb[fbidx]->fbops;
+	struct fb_info *info = registered_fb[fbidx];
+	struct fb_ops *fb = info->fbops;
 	struct fb_fix_screeninfo fix;
 	char *base_addr;
 	ssize_t copy_size;
 
 	if (! fb)
 		return -ENODEV;
-	fb->fb_get_fix(&fix, PROC_CONSOLE(), fbidx);
+	fb->fb_get_fix(&fix, PROC_CONSOLE(), info);
 	base_addr=(char *) fix.smem_start;
 	copy_size=(count + p <= fix.smem_len ? count : fix.smem_len - p);
 	copy_from_user(base_addr+p, buf, copy_size); 
@@ -200,9 +208,9 @@
     if (newidx != con2fb_map[unit]) {
        oldfb = registered_fb[oldidx];
        newfb = registered_fb[newidx];
-       if (newfb->fbops->fb_open(newidx))
+       if (newfb->fbops->fb_open(newfb))
 	   return;
-       oldfb->fbops->fb_release(oldidx);
+       oldfb->fbops->fb_release(oldfb);
        conp = fb_display[unit].conp;
        con2fb_map[unit] = newidx;
        fb_display[unit] = *(newfb->disp);
@@ -230,52 +238,48 @@
 fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	 unsigned long arg)
 {
-	struct fb_ops *fb = registered_fb[GET_FB_IDX(inode->i_rdev)]->fbops;
+	int fbidx = GET_FB_IDX(inode->i_rdev);
+	struct fb_info *info = registered_fb[fbidx];
+	struct fb_ops *fb = info->fbops;
 	struct fb_cmap cmap;
 	struct fb_var_screeninfo var;
 	struct fb_fix_screeninfo fix;
 	struct fb_con2fbmap con2fb;
-	int i, fbidx;
+	int i;
 	
 	if (! fb)
 		return -ENODEV;
 	switch (cmd) {
 	case FBIOGET_VSCREENINFO:
-		fbidx=GET_FB_IDX(inode->i_rdev);
-		if ((i = fb->fb_get_var(&var, PROC_CONSOLE(), fbidx)))
+		if ((i = fb->fb_get_var(&var, PROC_CONSOLE(), info)))
 			return i;
 		return copy_to_user((void *) arg, &var,
 				    sizeof(var)) ? -EFAULT : 0;
 	case FBIOPUT_VSCREENINFO:
-		fbidx=GET_FB_IDX(inode->i_rdev);
 		if (copy_from_user(&var, (void *) arg, sizeof(var)))
 			return -EFAULT;
-		if ((i = fb->fb_set_var(&var, PROC_CONSOLE(), fbidx)))
+		if ((i = fb->fb_set_var(&var, PROC_CONSOLE(), info)))
 			return i;
 		if (copy_to_user((void *) arg, &var, sizeof(var)))
 			return -EFAULT;
 		return 0;
 	case FBIOGET_FSCREENINFO:
-		fbidx=GET_FB_IDX(inode->i_rdev);
-		if ((i = fb->fb_get_fix(&fix, PROC_CONSOLE(), fbidx)))
+		if ((i = fb->fb_get_fix(&fix, PROC_CONSOLE(), info)))
 			return i;
 		return copy_to_user((void *) arg, &fix, sizeof(fix)) ?
 			-EFAULT : 0;
 	case FBIOPUTCMAP:
-		fbidx=GET_FB_IDX(inode->i_rdev);
 		if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
 			return -EFAULT;
-		return (fb->fb_set_cmap(&cmap, 0, PROC_CONSOLE(), fbidx));
+		return (fb->fb_set_cmap(&cmap, 0, PROC_CONSOLE(), info));
 	case FBIOGETCMAP:
-		fbidx=GET_FB_IDX(inode->i_rdev);
 		if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
 			return -EFAULT;
-		return (fb->fb_get_cmap(&cmap, 0, PROC_CONSOLE(), fbidx));
+		return (fb->fb_get_cmap(&cmap, 0, PROC_CONSOLE(), info));
 	case FBIOPAN_DISPLAY:
-		fbidx=GET_FB_IDX(inode->i_rdev);
 		if (copy_from_user(&var, (void *) arg, sizeof(var)))
 			return -EFAULT;
-		if ((i=fb->fb_pan_display(&var, PROC_CONSOLE(), fbidx)))
+		if ((i=fb->fb_pan_display(&var, PROC_CONSOLE(), info)))
 			return i;
 		if (copy_to_user((void *) arg, &var, sizeof(var)))
 			return -EFAULT;
@@ -309,9 +313,8 @@
 			set_con2fb_map(i, con2fb.framebuffer);
 		return 0;
 	default:
-		fbidx=GET_FB_IDX(inode->i_rdev);
-		return (fb->fb_ioctl(inode, file, cmd, arg, PROC_CONSOLE(),
-				     fbidx));
+		return fb->fb_ioctl(inode, file, cmd, arg, PROC_CONSOLE(),
+				    info);
 	}
 }
 
@@ -319,14 +322,15 @@
 fb_mmap(struct file *file, struct vm_area_struct * vma)
 {
 	int fbidx = GET_FB_IDX(file->f_dentry->d_inode->i_rdev);
-	struct fb_ops *fb = registered_fb[fbidx]->fbops;
+	struct fb_info *info = registered_fb[fbidx];
+	struct fb_ops *fb = info->fbops;
 	struct fb_fix_screeninfo fix;
 	unsigned char *start;
 	unsigned long len;
 
 	if (! fb)
 		return -ENODEV;
-	fb->fb_get_fix(&fix, PROC_CONSOLE(), fbidx);
+	fb->fb_get_fix(&fix, PROC_CONSOLE(), info);
 	if (vma->vm_offset < fix.smem_len) {
 		/* frame buffer memory */
 		start = fix.smem_start;
@@ -368,23 +372,25 @@
 static int
 fb_open(struct inode *inode, struct file *file)
 {
-	int fbidx=GET_FB_IDX(inode->i_rdev);
+	int fbidx = GET_FB_IDX(inode->i_rdev);
+	struct fb_info *info;
 
 #ifdef CONFIG_KERNELD
-	if (!registered_fb[fbidx])
+	if (!(info = registered_fb[fbidx]))
 		try_to_load(fbidx);
 #endif
-	if (!registered_fb[fbidx])
+	if (!(info = registered_fb[fbidx]))
 		return -ENODEV;
-	return registered_fb[fbidx]->fbops->fb_open(fbidx);
+	return info->fbops->fb_open(info);
 }
 
 static int 
 fb_release(struct inode *inode, struct file *file)
 {
-	int fbidx=GET_FB_IDX(inode->i_rdev);
+	int fbidx = GET_FB_IDX(inode->i_rdev);
+	struct fb_info *info = registered_fb[fbidx];
 
-	registered_fb[fbidx]->fbops->fb_release(fbidx);
+	info->fbops->fb_release(info);
 	return 0;
 }
 
@@ -422,7 +428,7 @@
 		 */
 		for (j = 0; j < MAX_NR_CONSOLES; j++)
 			if (con2fb_map[j] == i)
-				fb_info->fbops->fb_open(i);
+				fb_info->fbops->fb_open(fb_info);
 		fb_ever_opened[i] = 1;
 	}
 	return 0;
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/Config.in m68k-2.1.72/drivers/video/Config.in
--- m68k-2.1.72-status/drivers/video/Config.in	Wed Dec 24 13:01:12 1997
+++ m68k-2.1.72/drivers/video/Config.in	Wed Jan  7 22:03:24 1998
@@ -16,6 +16,7 @@
     fi
     tristate 'Amiga Cybervision support' CONFIG_FB_CYBER
     if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+      bool 'Amiga CyberVision3D support (experimental)' CONFIG_FB_CV3D
       tristate 'Amiga RetinaZ3 support' CONFIG_FB_RETINAZ3
     fi
   fi
@@ -23,9 +24,22 @@
     bool 'Atari native chipset support' CONFIG_FB_ATARI
     tristate 'Mach64 Frame Buffer support' CONFIG_FB_MACH64
   fi
+  if [ "$CONFIG_MAC" = "y" ]; then
+    define_bool CONFIG_FB_MAC y
+  fi
   if [ "$CONFIG_CHRP" = "y" -o "$CONFIG_PMAC" = "y" ]; then
     bool 'Open Firmware frame buffer device support' CONFIG_FB_OPEN_FIRMWARE
+    bool 'S3 Trio frame buffer device support' CONFIG_FB_S3TRIO
   fi 
+  if [ "$CONFIG_FB_OPEN_FIRMWARE" = "y" ]; then
+#   bool 'Apple "control" display support' CONFIG_FB_CONTROL
+#   bool 'Apple "platinum" display support' CONFIG_FB_PLATINUM
+#   bool 'Apple "valkyrie" display support' CONFIG_FB_VALKYRIE
+    bool 'ATI Mach64 display support' CONFIG_FB_ATY
+#   bool 'IMS Twin Turbo display support' CONFIG_FB_IMSTT
+#   bool 'Chips 65550 display support' CONFIG_FB_CT65550
+#   bool 'S3 Trio display support' CONFIG_FB_S3TRIO
+  fi
   if [ "$CONFIG_TGA_CONSOLE" = "y" ]; then
     define_bool CONFIG_FB_TGA y
   fi
@@ -41,12 +55,20 @@
     tristate 'Atari interleaved bitplanes (8 planes) support' CONFIG_FBCON_IPLAN2P8
     tristate '8 bpp packed pixel support' CONFIG_FBCON_CFB8
     tristate '16 bpp packed pixel support' CONFIG_FBCON_CFB16
+#   tristate '24 bpp packed pixel support' CONFIG_FBCON_CFB24
+    tristate '32 bpp packed pixel support' CONFIG_FBCON_CFB32
     tristate 'Cybervision support (accelerated)' CONFIG_FBCON_CYBER
+    tristate 'Cybervision3D support (accelerated)' CONFIG_FBCON_VIRGE
     tristate 'RetinaZ3 support (accelerated)' CONFIG_FBCON_RETINAZ3
     tristate 'Mach64 support (accelerated)' CONFIG_FBCON_MACH64
+    tristate 'S3Trio support (accelerated)' CONFIG_FBCON_TRIO
   else
+#
+# XXX: add Mac specific fbcon bits here (later)?
+#
     if [ "$CONFIG_FB_AMIGA" != "n" -o "$CONFIG_FB_ATARI" != "n" -o \
 	 "$CONFIG_FB_CYBER" != "n" -o "$CONFIG_FB_RETINAZ3" != "n" -o \
+	 "$CONFIG_FB_CV3D" != "n" -o "$CONFIG_FB_MAC" != "n" -o \
 	 "$CONFIG_FB_VIRTUAL" != "n" ]; then
       define_bool CONFIG_FBCON_MFB y
     fi
@@ -59,24 +81,45 @@
       define_bool CONFIG_FBCON_IPLAN2P4 y
       define_bool CONFIG_FBCON_IPLAN2P8 y
     fi
+    if [ "$CONFIG_FB_MAC" = "y" -o \
+	 "$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_VIRTUAL" = "m" ]; then
+      define_bool CONFIG_FBCON_MAC  y
+      define_bool CONFIG_FBCON_CFB2 y
+      define_bool CONFIG_FBCON_CFB4 y
+    fi
     if [ "$CONFIG_FB_ATARI" = "y" -o "$CONFIG_FB_ATARI" = "m" -o \
-	 "$CONFIG_FB_OPEN_FIRMWARE" = "y" -o \
-	 "$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_VIRTUAL" = "m" -o \
-	 "$CONFIG_FB_TGA" = "y" ]; then
+	 "$CONFIG_FB_OPEN_FIRMWARE" = "y" -o "$CONFIG_FB_MAC" = "y" -o \
+	 "$CONFIG_FB_TGA" = "y" -o \
+	 "$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_VIRTUAL" = "m" -o ]; then
       define_bool CONFIG_FBCON_CFB8 y
     fi
     if [ "$CONFIG_FB_ATARI" = "y" -o "$CONFIG_FB_ATARI" = "m" -o \
+	 "$CONFIG_FB_OPEN_FIRMWARE" = "y" -o "$CONFIG_FB_MAC" = "y" -o \
 	 "$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_VIRTUAL" = "m" ]; then
       define_bool CONFIG_FBCON_CFB16 y
     fi
+    if [ "$CONFIG_FB_ATARI" = "y" -o "$CONFIG_FB_ATARI" = "m" -o \
+	 "$CONFIG_FB_OPEN_FIRMWARE" = "y" -o \
+	 "$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_VIRTUAL" = "m" ]; then
+      define_bool CONFIG_FBCON_CFB32 y
+    fi
     if [ "$CONFIG_FB_CYBER" = "y" -o "$CONFIG_FB_CYBER" = "m" ]; then
       define_bool CONFIG_FBCON_CYBER y
     fi
+    if [ "$CONFIG_FB_CV3D" = "y" ]; then
+      define_bool CONFIG_FBCON_VIRGE y
+    fi
     if [ "$CONFIG_FB_RETINAZ3" = "y" -o "$CONFIG_FB_RETINAZ3" = "m" ]; then
       define_bool CONFIG_FBCON_RETINAZ3 y
     fi
     if [ "$CONFIG_FB_MACH64" = "y" -o "$CONFIG_FB_MACH64" = "m" ]; then
       define_bool CONFIG_FBCON_MACH64 y
+    fi
+    if [ "$CONFIG_FB_ATY" = "y" ]; then
+      define_bool CONFIG_FBCON_ATY y
+    fi
+    if [ "$CONFIG_FB_S3TRIO" = "y" -o "$CONFIG_FB_S3TRIO" = "m" ]; then
+      define_bool CONFIG_FBCON_TRIO y
     fi
   fi
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/Makefile m68k-2.1.72/drivers/video/Makefile
--- m68k-2.1.72-status/drivers/video/Makefile	Wed Dec 17 23:55:14 1997
+++ m68k-2.1.72/drivers/video/Makefile	Wed Jan  7 22:03:22 1998
@@ -22,8 +22,8 @@
 # Frame Buffer Console
 
 ifeq ($(CONFIG_FB),y)
-  L_OBJS += fonts.o font_8x8.o font_8x16.o pearl_8x8.o
-  LX_OBJS += fbcon.o fbcmap.o
+  L_OBJS += fonts.o font_8x8.o font_8x16.o pearl_8x8.o font_6x11.o
+  LX_OBJS += fbcon.o fbcmap.o fbgen.o
 endif
 
 # Frame buffer devices
@@ -48,11 +48,23 @@
   endif
 endif
 
+ifeq ($(CONFIG_MAC),y)
+L_OBJS += macfb.o
+endif
+
 ifeq ($(CONFIG_FB_CYBER),y)
 LX_OBJS += cyberfb.o
 else
   ifeq ($(CONFIG_FB_CYBER),m)
   MX_OBJS += cyberfb.o
+  else
+    ifeq ($(CONFIG_FB_CV3D),y)
+    LX_OBJS += cyberfb.o
+    else
+      ifeq ($(CONFIG_FB_CV3D),m)
+      MX_OBJS += cyberfb.o
+      endif
+    endif
   endif
 endif
 
@@ -76,6 +88,10 @@
 L_OBJS += offb.o
 endif
 
+ifeq ($(CONFIG_FB_ATY),y)
+L_OBJS += atyfb.o
+endif
+
 ifeq ($(CONFIG_FB_MACH64),y)
 L_OBJS += mach64fb.o
 else
@@ -88,6 +104,14 @@
 L_OBJS += tgafb.o
 endif
 
+ifeq ($(CONFIG_FB_S3TRIO),y)
+L_OBJS += S3triofb.o
+else
+  ifeq ($(CONFIG_FB_S3TRIO),m)
+  M_OBJS += S3triofb.o
+  endif
+endif
+
 # Low level drivers
 
 ifeq ($(CONFIG_FBCON_AFB),y)
@@ -98,6 +122,22 @@
   endif
 endif
 
+ifeq ($(CONFIG_FBCON_CFB2),y)
+L_OBJS += fbcon-cfb2.o
+else
+  ifeq ($(CONFIG_FBCON_CFB2),m)
+  M_OBJS += fbcon-cfb2.o
+  endif
+endif
+
+ifeq ($(CONFIG_FBCON_CFB4),y)
+L_OBJS += fbcon-cfb4.o
+else
+  ifeq ($(CONFIG_FBCON_CFB4),m)
+  M_OBJS += fbcon-cfb4.o
+  endif
+endif
+
 ifeq ($(CONFIG_FBCON_CFB8),y)
 L_OBJS += fbcon-cfb8.o
 else
@@ -114,6 +154,22 @@
   endif
 endif
 
+ifeq ($(CONFIG_FBCON_CFB24),y)
+LX_OBJS += fbcon-cfb24.o
+else
+  ifeq ($(CONFIG_FBCON_CFB24),m)
+  MX_OBJS += fbcon-cfb24.o
+  endif
+endif
+
+ifeq ($(CONFIG_FBCON_CFB32),y)
+LX_OBJS += fbcon-cfb32.o
+else
+  ifeq ($(CONFIG_FBCON_CFB32),m)
+  MX_OBJS += fbcon-cfb32.o
+  endif
+endif
+
 ifeq ($(CONFIG_FBCON_ILBM),y)
 L_OBJS += fbcon-ilbm.o
 else
@@ -162,6 +218,14 @@
   endif
 endif
 
+ifeq ($(CONFIG_FBCON_VIRGE),y)
+L_OBJS += fbcon-virge.o
+else
+  ifeq ($(CONFIG_FBCON_VIRGE),m)
+  M_OBJS += fbcon-virge.o
+  endif
+endif
+
 ifeq ($(CONFIG_FBCON_RETINAZ3),y)
 L_OBJS += fbcon-retz3.o
 else
@@ -176,6 +240,30 @@
   ifeq ($(CONFIG_FBCON_MACH64),m)
   M_OBJS += fbcon-mach64.o
   endif
+endif
+
+ifeq ($(CONFIG_FBCON_MAC),y)
+L_OBJS += fbcon-mac.o
+else
+  ifeq ($(CONFIG_FBCON_MAC),m)
+  M_OBJS += fbcon-mac.o
+  endif
+endif
+
+ifeq ($(CONFIG_FBCON_ATY),y)
+L_OBJS += fbcon-aty.o
+else
+  ifeq ($(CONFIG_FBCON_ATY),m)
+  M_OBJS += fbcon-aty.o
+  endif
+endif
+
+ifeq ($(CONFIG_FBCON_TRIO),y)
+L_OBJS += fbcon-trio.o
+else
+  ifeq ($(CONFIG_FBCON_TRIO),m)
+  M_OBJS += fbcon-trio.o
+  endif 
 endif
 
 # GSP Console
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/amifb.c m68k-2.1.72/drivers/video/amifb.c
--- m68k-2.1.72-status/drivers/video/amifb.c	Wed Dec 17 23:55:14 1997
+++ m68k-2.1.72/drivers/video/amifb.c	Wed Jan  7 23:28:37 1998
@@ -1155,19 +1155,22 @@
 
 void amifb_setup(char *options, int *ints);
 
-static int amifb_open(int fbidx);
-static int amifb_release(int fbidx);
-static int amifb_get_fix(struct fb_fix_screeninfo *fix, int con, int fbidx);
-static int amifb_get_var(struct fb_var_screeninfo *var, int con, int fbidx);
-static int amifb_set_var(struct fb_var_screeninfo *var, int con, int fbidx);
+static int amifb_open(struct fb_info *info);
+static int amifb_release(struct fb_info *info);
+static int amifb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			 struct fb_info *info);
+static int amifb_get_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info);
+static int amifb_set_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info);
 static int amifb_pan_display(struct fb_var_screeninfo *var, int con,
-				int fbidx);
+			     struct fb_info *info);
 static int amifb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
-			     int fbidx);
+			  struct fb_info *info);
 static int amifb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
-			     int fbidx);
+			  struct fb_info *info);
 static int amifb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-                          u_long arg, int con, int fbidx);
+		       u_long arg, int con, struct fb_info *info);
 
 static int amifb_get_fix_cursorinfo(struct fb_fix_cursorinfo *fix, int con);
 static int amifb_get_var_cursorinfo(struct fb_var_cursorinfo *var,
@@ -1182,15 +1185,15 @@
 	 */
 
 unsigned long amifb_init(unsigned long mem_start);
-static int amifbcon_switch(int con);
-static int amifbcon_updatevar(int con);
-static void amifbcon_blank(int blank);
+static int amifbcon_switch(int con, struct fb_info *info);
+static int amifbcon_updatevar(int con, struct fb_info *info);
+static void amifbcon_blank(int blank, struct fb_info *info);
 
 	/*
 	 * Internal routines
 	 */
 
-static void do_install_cmap(int con);
+static void do_install_cmap(int con, struct fb_info *info);
 static int flash_cursor(void);
 static void amifb_interrupt(int irq, void *dev_id, struct pt_regs *fp);
 static void get_video_mode(const char *name);
@@ -1216,9 +1219,9 @@
 static void ami_pan_var(struct fb_var_screeninfo *var);
 static int ami_update_par(void);
 static int ami_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
-                         u_int *transp);
+                         u_int *transp, struct fb_info *info);
 static int ami_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-                         u_int transp);
+                         u_int transp, struct fb_info *info);
 static void ami_update_display(void);
 static void ami_init_display(void);
 static void ami_do_blank(void);
@@ -1384,7 +1387,7 @@
 	 * Open/Release the frame buffer device
 	 */
 
-static int amifb_open(int fbidx)
+static int amifb_open(struct fb_info *info)
 {
 	/*
 	 * Nothing, only a usage count for the moment
@@ -1394,7 +1397,7 @@
 	return(0);
 }
 
-static int amifb_release(int fbidx)
+static int amifb_release(struct fb_info *info)
 {
 	MOD_DEC_USE_COUNT;
 	return(0);
@@ -1405,7 +1408,8 @@
 	 * Get the Fixed Part of the Display
 	 */
 
-static int amifb_get_fix(struct fb_fix_screeninfo *fix, int con, int fbidx)
+static int amifb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			 struct fb_info *info)
 {
 	struct amifb_par par;
 
@@ -1424,7 +1428,8 @@
 	 * Get the User Defined Part of the Display
 	 */
 
-static int amifb_get_var(struct fb_var_screeninfo *var, int con, int fbidx)
+static int amifb_get_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info)
 {
 	int err = 0;
 
@@ -1442,7 +1447,8 @@
 	 * Set the User Defined Part of the Display
 	 */
 
-static int amifb_set_var(struct fb_var_screeninfo *var, int con, int fbidx)
+static int amifb_set_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info)
 {
 	int err, activate = var->activate;
 	int oldxres, oldyres, oldvxres, oldvyres, oldbpp;
@@ -1495,7 +1501,7 @@
 		if (oldbpp != var->bits_per_pixel) {
 			if ((err = fb_alloc_cmap(&display->cmap, 0, 0)))
 				return err;
-			do_install_cmap(con);
+			do_install_cmap(con, info);
 		}
 		if (con == currcon)
 			ami_set_var(&display->var);
@@ -1510,7 +1516,7 @@
 	 */
 
 static int amifb_pan_display(struct fb_var_screeninfo *var, int con,
-				int fbidx)
+				struct fb_info *info)
 {
 	if (var->vmode & FB_VMODE_YWRAP) {
 		if (var->yoffset<0 || var->yoffset >= fb_display[con].var.yres_virtual || var->xoffset)
@@ -1540,15 +1546,15 @@
 	 */
 
 static int amifb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
-			     int fbidx)
+			  struct fb_info *info)
 {
 	if (con == currcon) /* current console? */
 		return fb_get_cmap(cmap, &fb_display[con].var, kspc,
-				   ami_getcolreg);
+				   ami_getcolreg, info);
 	else if (fb_display[con].cmap.len) /* non default colormap? */
 		fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
 	else
-		fb_copy_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
+		fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
 			     cmap, kspc ? 0 : 2);
 	return 0;
 }
@@ -1558,7 +1564,7 @@
 	 */
 
 static int amifb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
-			     int fbidx)
+			  struct fb_info *info)
 {
 	int err;
 
@@ -1570,7 +1576,7 @@
 	}
 	if (con == currcon)			/* current console? */
 		return fb_set_cmap(cmap, &fb_display[con].var, kspc,
-				   ami_setcolreg);
+				   ami_setcolreg, info);
 	else
 		fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
 	return 0;
@@ -1581,7 +1587,7 @@
 	 */
 
 static int amifb_ioctl(struct inode *inode, struct file *file,
-                          u_int cmd, u_long arg, int con, int fbidx)
+                       u_int cmd, u_long arg, int con, struct fb_info *info)
 {
 	int i;
 
@@ -1866,7 +1872,7 @@
 	custom.intena = IF_VERTB;
 	custom.intena = IF_SETCLR | IF_COPER;
 
-	amifb_set_var(&amifb_default, -1, GET_FB_IDX(fb_info.node));
+	amifb_set_var(&amifb_default, -1, &fb_info);
 
 	printk("%s frame buffer device, using %ldK of video memory\n",
 	       fb_info.modename, videomemorysize>>10);
@@ -1877,17 +1883,17 @@
 	return mem_start;
 }
 
-static int amifbcon_switch(int con)
+static int amifbcon_switch(int con, struct fb_info *info)
 {
 	/* Do we have to save the colormap? */
 	if (fb_display[currcon].cmap.len)
 		fb_get_cmap(&fb_display[currcon].cmap,
-			    &fb_display[currcon].var, 1, ami_getcolreg);
+			    &fb_display[currcon].var, 1, ami_getcolreg, info);
 
 	currcon = con;
 	ami_set_var(&fb_display[con].var);
 	/* Install new colormap */
-	do_install_cmap(con);
+	do_install_cmap(con, info);
 	return 0;
 }
 
@@ -1895,7 +1901,7 @@
 	 * Update the `var' structure (called by fbcon.c)
 	 */
 
-static int amifbcon_updatevar(int con)
+static int amifbcon_updatevar(int con, struct fb_info *info)
 {
 	ami_pan_var(&fb_display[con].var);
 	return 0;
@@ -1905,7 +1911,7 @@
 	 * Blank the display.
 	 */
 
-static void amifbcon_blank(int blank)
+static void amifbcon_blank(int blank, struct fb_info *info)
 {
 	do_blank = blank ? blank : -1;
 }
@@ -1914,17 +1920,17 @@
 	 * Set the colormap
 	 */
 
-static void do_install_cmap(int con)
+static void do_install_cmap(int con, struct fb_info *info)
 {
 	if (con != currcon)
 		return;
 	if (fb_display[con].cmap.len)
 		fb_set_cmap(&fb_display[con].cmap, &fb_display[con].var, 1,
-			    ami_setcolreg);
+			    ami_setcolreg, info);
 	else
-		fb_set_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
+		fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
 					    &fb_display[con].var, 1,
-					    ami_setcolreg);
+					    ami_setcolreg, info);
 }
 
 static int flash_cursor(void)
@@ -2750,7 +2756,7 @@
 	 */
 
 static int ami_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
-                         u_int *transp)
+                         u_int *transp, struct fb_info *info)
 {
 	if (IS_AGA) {
 		if (regno > 255)
@@ -2774,7 +2780,7 @@
 	 */
 
 static int ami_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-                         u_int transp)
+                         u_int transp, struct fb_info *info)
 {
 #if defined(CONFIG_FB_AMIGA_AGA)
 	u_short bplcon3 = currentpar.bplcon3;
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/atafb.c m68k-2.1.72/drivers/video/atafb.c
--- m68k-2.1.72-status/drivers/video/atafb.c	Mon Dec 22 21:21:47 1997
+++ m68k-2.1.72/drivers/video/atafb.c	Wed Jan  7 23:27:19 1998
@@ -240,7 +240,7 @@
 extern unsigned char fontdata_8x16[];
 
 /* import first 16 colors from fbcon.c */
-extern unsigned short packed16_cmap[16];
+extern unsigned short cfb16_cmap[16];
 
 
 /* ++roman: This structure abstracts from the underlying hardware (ST(e),
@@ -278,14 +278,14 @@
  *   
  * int (*setcolreg)( unsigned regno, unsigned red,
  *                   unsigned green, unsigned blue,
- *                   unsigned transp )
+ *                   unsigned transp, struct fb_info *info )
  *   Set a single color register. The values supplied are already
  *   rounded down to the hardware's capabilities (according to the
  *   entries in the var structure). Return != 0 for invalid regno.
  *
  * int (*getcolreg)( unsigned regno, unsigned *red,
  *                   unsigned *green, unsigned *blue,
- *                   unsigned *transp )
+ *                   unsigned *transp, struct fb_info *info )
  *   Read a single color register and split it into
  *   colors/transparent. Return != 0 for invalid regno.
  *
@@ -314,10 +314,10 @@
 	void (*set_par)( struct atafb_par *par );
 	int  (*getcolreg)( unsigned regno, unsigned *red,
 					   unsigned *green, unsigned *blue,
-					   unsigned *transp );
+					   unsigned *transp, struct fb_info *info );
 	int  (*setcolreg)( unsigned regno, unsigned red,
 					   unsigned green, unsigned blue,
-					   unsigned transp );
+					   unsigned transp, struct fb_info *info );
 	void (*set_screen_base)( unsigned long s_base );
 	int  (*blank)( int blank_mode );
 	int  (*pan_display)( struct fb_var_screeninfo *var,
@@ -675,7 +675,7 @@
 
 static int tt_getcolreg( unsigned regno, unsigned *red,
 						 unsigned *green, unsigned *blue,
-						 unsigned *transp )
+						 unsigned *transp, struct fb_info *info )
 {
 	if ((shifter_tt.tt_shiftmode & TT_SHIFTER_MODEMASK) == TT_SHIFTER_STHIGH)
 		regno += 254;
@@ -692,7 +692,7 @@
 
 static int tt_setcolreg( unsigned regno, unsigned red,
 						 unsigned green, unsigned blue,
-						 unsigned transp )
+						 unsigned transp, struct fb_info *info )
 {
 	if ((shifter_tt.tt_shiftmode & TT_SHIFTER_MODEMASK) == TT_SHIFTER_STHIGH)
 		regno += 254;
@@ -1595,7 +1595,7 @@
 
 static int falcon_getcolreg( unsigned regno, unsigned *red,
 				 unsigned *green, unsigned *blue,
-				 unsigned *transp )
+				 unsigned *transp, struct fb_info *info )
 {	unsigned long col;
 	
 	if (regno > 255)
@@ -1615,7 +1615,7 @@
 
 static int falcon_setcolreg( unsigned regno, unsigned red,
 							 unsigned green, unsigned blue,
-							 unsigned transp )
+							 unsigned transp, struct fb_info *info )
 {
 	if (regno > 255)
 		return 1;
@@ -1626,7 +1626,7 @@
 			(((green & 0xe) >> 1) | ((green & 1) << 3) << 4) |
 			((blue & 0xe) >> 1) | ((blue & 1) << 3);
 #ifdef CONFIG_FBCON_CFB16
-		packed16_cmap[regno] = (red << 11) | (green << 5) | blue;
+		cfb16_cmap[regno] = (red << 11) | (green << 5) | blue;
 #endif
 	}
 	return 0;
@@ -1908,7 +1908,7 @@
 
 static int stste_getcolreg( unsigned regno, unsigned *red,
 							unsigned *green, unsigned *blue,
-							unsigned *transp )
+							unsigned *transp, struct fb_info *info )
 {	unsigned col;
 	
 	if (regno > 15)
@@ -1931,7 +1931,7 @@
 
 static int stste_setcolreg( unsigned regno, unsigned red,
 						 unsigned green, unsigned blue,
-						 unsigned transp )
+						 unsigned transp, struct fb_info *info )
 {
 	if (regno > 15)
 		return 1;
@@ -2178,7 +2178,7 @@
 
 static int ext_getcolreg( unsigned regno, unsigned *red,
 						  unsigned *green, unsigned *blue,
-						  unsigned *transp )
+						  unsigned *transp, struct fb_info *info )
 {
 	if (! external_vgaiobase)
 		return 1;
@@ -2192,7 +2192,7 @@
 	
 static int ext_setcolreg( unsigned regno, unsigned red,
 						  unsigned green, unsigned blue,
-						  unsigned transp )
+						  unsigned transp, struct fb_info *info )
 
 {	unsigned char colmask = (1 << external_bitspercol) - 1;
 
@@ -2334,7 +2334,7 @@
 /* used for hardware scrolling */
 
 static int
-fb_update_var(int con)
+fb_update_var(int con, struct fb_info *info)
 {
 	int off=fb_display[con].var.yoffset*fb_display[con].var.xres_virtual*
 			fb_display[con].var.bits_per_pixel>>3;
@@ -2364,17 +2364,17 @@
 /* Functions for handling colormap */
 
 static void
-do_install_cmap(int con)
+do_install_cmap(int con, struct fb_info *info)
 {
 	if (con != currcon)
 		return;
 	if (fb_display[con].cmap.len)
 		fb_set_cmap(&fb_display[con].cmap, &(fb_display[con].var), 1,
-			    fbhw->setcolreg);
+			    fbhw->setcolreg, info);
 	else
-		fb_set_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
+		fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
 					    &(fb_display[con].var), 1,
-					    fbhw->setcolreg);		
+					    fbhw->setcolreg, info);		
 }
 
 
@@ -2382,7 +2382,7 @@
 	 * Open/Release the frame buffer device
 	 */
 
-static int atafb_open(int fbidx)
+static int atafb_open(struct fb_info *info)
 {
 	/*
 	 * Nothing, only a usage count for the moment
@@ -2392,7 +2392,7 @@
 	return(0);
 }
 
-static int atafb_release(int fbidx)
+static int atafb_release(struct fb_info *info)
 {
 	MOD_DEC_USE_COUNT;
 	return(0);
@@ -2400,7 +2400,7 @@
 
 
 static int
-atafb_get_fix(struct fb_fix_screeninfo *fix, int con, int fbidx)
+atafb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info)
 {
 	struct atafb_par par;
 	if (con == -1)
@@ -2412,7 +2412,7 @@
 }
 	
 static int
-atafb_get_var(struct fb_var_screeninfo *var, int con, int fbidx)
+atafb_get_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
 {
 	struct atafb_par par;
 	if (con == -1) {
@@ -2425,7 +2425,7 @@
 }
 
 static void
-atafb_set_disp(int con)
+atafb_set_disp(int con, struct fb_info *info)
 {
 	struct fb_fix_screeninfo fix;
 	struct display *display;
@@ -2435,8 +2435,7 @@
 	else
 		display = &disp;	/* used during initialization */
 
-	/* ### FN: Needs fixes later */
-	atafb_get_fix(&fix, con, 0);
+	atafb_get_fix(&fix, con, info);
 	if (con == -1)
 		con=0;
 	display->screen_base = (u_char *)fix.smem_start;
@@ -2456,7 +2455,7 @@
 }
 
 static int
-atafb_set_var(struct fb_var_screeninfo *var, int con, int fbidx)
+atafb_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
 {
 	int err,oldxres,oldyres,oldbpp,oldxres_virtual,
 	    oldyres_virtual,oldyoffset;
@@ -2475,10 +2474,10 @@
 		    || oldyres_virtual != var->yres_virtual
 		    || oldbpp != var->bits_per_pixel
 		    || oldyoffset != var->yoffset) {
-			atafb_set_disp(con);
+			atafb_set_disp(con, info);
 			(*fb_info.changevar)(con);
 			fb_alloc_cmap(&fb_display[con].cmap, 0, 0);
-			do_install_cmap(con);
+			do_install_cmap(con, info);
 		}
 	}
 	var->activate=0;
@@ -2488,22 +2487,22 @@
 
 
 static int
-atafb_get_cmap(struct fb_cmap *cmap, int kspc, int con, int fbidx)
+atafb_get_cmap(struct fb_cmap *cmap, int kspc, int con, struct fb_info *info)
 {
 	if (con == currcon) /* current console ? */
 		return fb_get_cmap(cmap, &(fb_display[con].var), kspc,
-				   fbhw->getcolreg);
+				   fbhw->getcolreg, info);
 	else
 		if (fb_display[con].cmap.len) /* non default colormap ? */
 			fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
 		else
-			fb_copy_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
+			fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
 				     cmap, kspc ? 0 : 2);
 	return 0;
 }
 
 static int
-atafb_set_cmap(struct fb_cmap *cmap, int kspc, int con, int fbidx)
+atafb_set_cmap(struct fb_cmap *cmap, int kspc, int con, struct fb_info *info)
 {
 	int err;
 	if (! fb_display[con].cmap.len) { /* no colormap allocated ? */
@@ -2514,14 +2513,14 @@
 	}
 	if (con == currcon) /* current console ? */
 		return fb_set_cmap(cmap, &(fb_display[con].var), kspc,
-				   fbhw->setcolreg);
+				   fbhw->setcolreg, info);
 	else
 		fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
 	return 0;
 }
 
 static int
-atafb_pan_display(struct fb_var_screeninfo *var, int con, int fbidx)
+atafb_pan_display(struct fb_var_screeninfo *var, int con, struct fb_info *info)
 {
 	int xoffset = var->xoffset;
 	int yoffset = var->yoffset;
@@ -2546,7 +2545,7 @@
 
 static int
 atafb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-	       unsigned long arg, int con, int fbidx)
+	       unsigned long arg, int con, struct fb_info *info)
 {
 	switch (cmd) {
 #ifdef FBCMD_GET_CURRENTPAR
@@ -2616,16 +2615,17 @@
 }
 
 static int
-atafb_switch(int con)
+atafb_switch(int con, struct fb_info *info)
 {
 	/* Do we have to save the colormap ? */
 	if (fb_display[currcon].cmap.len)
 		fb_get_cmap(&fb_display[currcon].cmap,
-			    &(fb_display[currcon].var), 1, fbhw->getcolreg);
+			    &(fb_display[currcon].var), 1, fbhw->getcolreg,
+			    info);
 	do_fb_set_var(&fb_display[con].var,1);
 	currcon=con;
 	/* Install new colormap */
-	do_install_cmap(con);
+	do_install_cmap(con, info);
 	return 0;
 }
 
@@ -2637,7 +2637,7 @@
  * 4 = off
  */
 static void
-atafb_blank(int blank)
+atafb_blank(int blank, struct fb_info *info)
 {
 	unsigned short black[16];
 	struct fb_cmap cmap;
@@ -2652,10 +2652,10 @@
 		cmap.start=0;
 		cmap.len=16;
 		fb_set_cmap(&cmap, &(fb_display[currcon].var), 1,
-			    fbhw->setcolreg);
+			    fbhw->setcolreg, info);
 	}
 	else
-		do_install_cmap(currcon);
+		do_install_cmap(currcon, info);
 }
 
 __initfunc(unsigned long atafb_init(unsigned long mem_start))
@@ -2761,15 +2761,15 @@
 	if (err < 0)
 		return(err);
 
-	atafb_get_var(&disp.var, -1, GET_FB_IDX(fb_info.node));
-	atafb_set_disp(-1);
+	atafb_get_var(&disp.var, -1, &fb_info);
+	atafb_set_disp(-1, &fb_info);
 	printk("Determined %dx%d, depth %d\n",
 	       disp.var.xres, disp.var.yres, disp.var.bits_per_pixel);
 	if ((disp.var.xres != disp.var.xres_virtual) ||
 	    (disp.var.yres != disp.var.yres_virtual))
 	   printk("   virtual %dx%d\n",
 			  disp.var.xres_virtual, disp.var.yres_virtual);
-	do_install_cmap(0);
+	do_install_cmap(0, &fb_info);
 	printk("%s frame buffer device, using %dK of video memory\n",
 	       fb_info.modename, screen_len>>10);
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/ati-gt.h m68k-2.1.72/drivers/video/ati-gt.h
--- m68k-2.1.72-status/drivers/video/ati-gt.h	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/ati-gt.h	Wed Jan  7 22:03:26 1998
@@ -0,0 +1,203 @@
+/* the usage for the following structs vary from the gx and vt:
+and sdram and sgram gt's
+	pll registers (sdram) 6,7,11;
+	crtc_h_sync_strt_wid[3];
+	dsp1[3] (sdram,sgram,unused)
+	dsp2[3] (offset regbase+24, depends on colour mode);
+	crtc_h_tot_disp,crtc_v_tot_disp,crtc_v_sync_strt_wid,unused;
+	pll registers (sgram) 7,11;
+*/
+
+/* Register values for 1280x1024, 75Hz mode (20). no 16/32 */
+static struct aty_regvals aty_gt_reg_init_20 = {
+	{ 0x41, 0xf9, 0x04 },
+	{ 0xe02a7, 0x1401a6, 0 },
+	{ 0x260957, 0x2806d6, 0 },
+	{ 0x10006b6, 0x20006b6, 0x30006b6 },
+
+	0x9f00d2, 0x03ff0429, 0x30400, 0,
+	{ 0xb5, 0x04 }
+};
+
+#if 0
+/* Register values for 1280x960, 75Hz mode (19) */
+static struct aty_regvals aty_gt_reg_init_19 = {
+};
+#endif
+
+/* Register values for 1152x870, 75Hz mode (18) */
+static struct aty_regvals aty_gt_reg_init_18 = {
+	{ 0x41, 0xe6, 0x04 },
+	{ 0x300295, 0x300194, 0x300593 },
+	{ 0x260a1c, 0x380561, 0},
+	{ 0x1000744, 0x2000744, 0x3000744 },
+
+	0x8f00b5, 0x3650392, 0x230368, 0,
+	{ 0xe6, 0x04 }
+};
+
+/* Register values for 1024x768, 75Hz mode (17), 32 bpp untested */
+static struct aty_regvals aty_gt_reg_init_17 = {
+	{ 0x41, 0xb5, 0x04 },
+	{ 0xc0283, 0xc0182, 0xc0581 },
+	{ 0x36066d, 0x3806d6, 0},
+	{ 0xa0049e, 0x100049e, 0x200049e },
+
+	0x7f00a3, 0x2ff031f, 0x30300, 0,
+	{ 0xb8, 0x04 }
+};
+
+#if 0
+/* Register values for x, Hz mode (16) */
+static struct aty_regvals aty_gt_reg_init_16 = {
+};
+#endif
+
+/* Register values for 1024x768, 70Hz mode (15) */
+static struct aty_regvals aty_gt_reg_init_15 = {
+	{ 0x41, 0xad, 0x04 },
+	{ 0x310284, 0x310183, 0x310582 },
+	{ 0x0, 0x380727 },
+	{ 0x0 },
+	0x7f00a5, 0x2ff0325, 0x260302,
+};    
+
+/* Register values for 1024x768, 60Hz mode (14) */
+static struct aty_regvals aty_gt_reg_init_14 = {
+	{ 0x40, 0xe1, 0x14 },
+	{ 0x310284, 0x310183, 0x310582 },
+	{ 0x3607c0, 0x380840, 0x0 },
+	{ 0xa80592, 0x1000592, 0x0 },
+
+	0x7f00a7, 0x2ff0325, 0x260302, 0,
+	{ 0xe1, 0x14 }
+};  
+
+/* Register values for 832x624, 75Hz mode (13) */
+static struct aty_regvals aty_gt_reg_init_13 = {
+	{ 0x40, 0xc6, 0x14 },
+	{ 0x28026d, 0x28016c, 0x28056b },
+	{ 0x3608cf, 0x380960, 0 },
+	{ 0xb00655, 0x1000655, 0x2000655 },
+
+	0x67008f, 0x26f029a, 0x230270, 0,
+	{ 0xc6, 0x14 }
+};
+
+/* Register values for 800x600, 75Hz mode (12) */
+static struct aty_regvals aty_gt_reg_init_12 = {
+	{ 0x42, 0xe4, 0x04 },
+	{ 0xa0267, 0xa0166, 0x0a0565},
+	{ 0x360a33, 0x48056d, 0},
+	{ 0xc00755, 0x1000755, 0x02000755},
+
+	0x630083, 0x2570270, 0x30258, 0,
+	{ 0xe4, 0x4 }
+};
+
+/* Register values for 800x600, 72Hz mode (11) */
+static struct aty_regvals aty_gt_reg_init_11 = {
+	{ 0x42, 0xe6, 0x04 },
+	{ 0xf026c, 0xf016b, 0xf056a },
+	{ 0x360a1d, 0x480561, 0},
+	{ 0xc00745, 0x1000745, 0x2000745 },
+	
+	0x630081, 0x02570299, 0x6027c
+};
+
+/* Register values for 800x600, 60Hz mode (10) */
+static struct aty_regvals aty_gt_reg_init_10 = {
+	{ 0x42, 0xb8, 0x04 },
+	{ 0x10026a, 0x100169, 0x100568 },
+	{ 0x460652, 0x4806ba, 0},
+	{ 0x68048b, 0xa0048b, 0x100048b },
+
+	0x630083, 0x02570273, 0x40258, 0,
+	{ 0xb8, 0x4 }
+};
+
+/* Register values for 800x600, 56Hz mode (9) */
+static struct aty_regvals aty_gt_reg_init_9 = {
+	{ 0x42, 0xf9, 0x14 },
+	{ 0x90268, 0x90167, 0x090566 },
+	{ 0x460701, 0x480774, 0},
+	{ 0x700509, 0xa80509, 0x1000509 },
+
+	0x63007f, 0x2570270, 0x20258
+};
+
+#if 0
+/* Register values for 768x576, 50Hz mode (8) */
+static struct aty_regvals aty_gt_reg_init_8 = {
+};
+
+/* Register values for 640x870, 75Hz Full Page Display (7) */
+static struct aty_regvals aty_gt_reg_init_7 = {
+};
+#endif
+
+/* Register values for 640x480, 67Hz mode (6) */
+static struct aty_regvals aty_gt_reg_init_6 = {
+	{ 0x42, 0xd1, 0x14 },
+	{ 0x280259, 0x280158, 0x280557 },
+	{ 0x460858, 0x4808e2, 0},
+	{ 0x780600, 0xb00600, 0x1000600 },
+
+	0x4f006b, 0x1df020c, 0x2301e2, 0,
+	{ 0x8b, 0x4 }
+};
+
+/* Register values for 640x480, 60Hz mode (5) */
+static struct aty_regvals aty_gt_reg_init_5 = {
+	{ 0x43, 0xe8, 0x04 },
+	{ 0x2c0253, 0x2c0152, 0x2c0551 },
+	{ 0x460a06, 0x580555, 0},
+	{ 0x880734, 0xc00734, 0x1000734 },
+
+	0x4f0063, 0x1df020c, 0x2201e9, 0,
+	{ 0xe8, 0x04 }
+};
+
+#if 0
+/* Register values for x, Hz mode (4) */
+static struct aty_regvals aty_gt_reg_init_4 = {
+};
+
+/* Register values for x, Hz mode (3) */
+static struct aty_regvals aty_gt_reg_init_3 = {
+};
+
+/* Register values for x, Hz mode (2) */
+static struct aty_regvals aty_gt_reg_init_2 = {
+};
+
+/* Register values for x, Hz mode (1) */
+static struct aty_regvals aty_gt_reg_init_1 = {
+};
+#endif
+
+/* yikes, more data structures (dsp2)
+ * XXX kludge for sgram
+ */
+static int sgram_dsp[20][3] = {
+	{0,0,0},
+	{0,0,0},
+	{0,0,0},
+	{0,0,0},
+	{0x5203d7,0x7803d9,0xb803dd}, //5
+	{0x940666,0xe0066a,0x1700672}, //6
+	{0,0,0},
+	{0,0,0},
+	{0x88055f,0xd80563,0x170056b}, //9
+	{0x8404d9,0xb804dd,0x17004e5}, //10
+	{0x7803e2,0xb803e6,0x17003ee}, //11
+	{0x7803eb,0xb803ef,0x17003f7}, //12
+	{0xe806c5,0x17006cd,0x2e006dd}, //13
+	{0xe005f6,0x17005fe,0x2e0060e}, //14
+	{0xd8052c,0x1700534,0x2e00544}, //15
+	{0,0,0},
+	{0xb804f2,0x17004e5,0x2e0050a}, //17
+	{0xb803e6,0x17003ee,0x2e003fe}, //18
+	{0,0,0},
+	{0,0,0},
+};
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/ati-gx.h m68k-2.1.72/drivers/video/ati-gx.h
--- m68k-2.1.72-status/drivers/video/ati-gx.h	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/ati-gx.h	Wed Jan  7 22:03:26 1998
@@ -0,0 +1,149 @@
+#if 0		/* not filled inaty_gt_reg_init yet */
+/* Register values for 1280x1024, 75Hz mode (20) */
+static struct aty_regvals aty_gx_reg_init_20 = {
+	{ 0x10, 0x28, 0x3c },
+	{ },
+	{ }	/* pixel clock = 134.61MHz for V=74.81Hz */
+};
+
+/* Register values for 1280x960, 75Hz mode (19) */
+static struct aty_regvals aty_gx_reg_init_19 = {
+	{ 0x10, 0x28, 0x3c },
+	{ },
+	{ }	/* pixel clock = 126.01MHz for V=75.01 Hz */
+};
+
+/* Register values for 1152x870, 75Hz mode (18) */
+static struct aty_regvals aty_gx_reg_init_18 = {
+	{ 0x10, 0x28, 0x50 },
+	{ },
+	{ }	/* pixel clock = 100.33MHz for V=75.31Hz */
+};
+
+/* Register values for 1024x768, 75Hz mode (17) */
+static struct aty_regvals aty_gx_reg_init_17 = {
+	{ 0x10, 0x28, 0x50 },
+	{ },
+	{ }	/* pixel clock = 79.55MHz for V=74.50Hz */
+};
+
+/* Register values for 1024x768, 72Hz mode (15) */
+static struct aty_regvals aty_gx_reg_init_15 = {
+	{ 0x10, 0x28, 0x50 },
+	{ },
+	{ }	/* pixel clock = 78.12MHz for V=72.12Hz */
+};
+
+#endif
+
+
+/* Register values for 1280x1024, 60Hz mode (20) */
+static struct aty_regvals aty_gx_reg_init_20 = {
+   { 0, 0, 0 },
+
+    { 0x310086, 0x310084, 0x310084 },
+    { 0x3070200, 0x30e0300, 0x30e0300 },
+    { 0x2002312, 0x3002312, 0x3002312 },
+
+    0x7f00a5, 0x2ff0325, 0x260302, 0x20100000,
+    { 0x88, 0x7 }
+};     
+
+/* Register values for 1024x768, 75Hz mode (17) */
+static struct aty_regvals aty_gx_reg_init_17 = {
+    { 0, 0, 0 },
+
+    { 0xc0085, 0xc0083, 0xc0083 },
+    { 0x3070200, 0x30e0300, 0x30e0300 },
+    { 0x2002312, 0x3002312, 0x3002312 },
+
+    0x7f00a3, 0x2ff031f, 0x30300, 0x20100000,
+    { 0x41, 0x3 }
+};
+
+/* Register values for 1024x768, 72Hz mode (15) */
+static struct aty_regvals aty_gx_reg_init_15 = {
+    { 0, 0, 0 },
+
+    { 0x310086, 0x310084, 0x310084 },
+    { 0x3070200, 0x30e0300, 0x30e0300 },
+    { 0x2002312, 0x3002312, 0x3002312 },
+
+    0x7f00a5, 0x2ff0325, 0x260302, 0x20100000,
+    { 0x88, 0x7 }
+};    
+
+/* Register values for 1024x768, 60Hz mode (14) */
+static struct aty_regvals aty_gx_reg_init_14 = {
+	{ 0, 0, 0 },
+
+	{ 0x310086, 0x310084, 0x310084 },
+	{ 0x3060200, 0x30d0300, 0x30d0300 },
+	{ 0x2002312, 0x3002312, 0x3002312 },
+
+	0x7f00a7, 0x2ff0325, 0x260302, 0x20100000,
+	{ 0x6c, 0x6 }
+};  
+
+/* Register values for 832x624, 75Hz mode (13) */
+static struct aty_regvals aty_gx_reg_init_13 = {
+	{ 0x200, 0x200, 0x200 },
+
+	{ 0x28006f, 0x28006d, 0x28006c },
+	{ 0x3050200, 0x30b0300, 0x30e0600 },
+	{ 0x2002312, 0x3002312, 0x6002312 },
+
+	0x67008f, 0x26f029a, 0x230270, 0x1a100040,
+        { 0x4f, 0x05 }
+};
+
+#if 0		/* not filled in yet */
+/* Register values for 800x600, 75Hz mode (12) */
+static struct aty_regvals aty_gx_reg_init_12 = {
+	{ 0x10, 0x28, 0x50 },
+	{ },
+	{ }	/* pixel clock = 49.11MHz for V=74.40Hz */
+};
+
+/* Register values for 800x600, 72Hz mode (11) */
+static struct aty_regvals aty_gx_reg_init_11 = {
+	{ 0x10, 0x28, 0x50 },
+	{ },
+	{ }	/* pixel clock = 49.63MHz for V=71.66Hz */
+};
+
+/* Register values for 800x600, 60Hz mode (10) */
+static struct aty_regvals aty_gx_reg_init_10 = {
+	{ 0x10, 0x28, 0x50 },
+	{ },
+	{ }	/* pixel clock = 41.41MHz for V=59.78Hz */
+};
+
+/* Register values for 640x870, 75Hz Full Page Display (7) */
+static struct aty_regvals aty_gx_reg_init_7 = {
+	{ 0x10, 0x30, 0x68 },
+	{ },
+	{ }	/* pixel clock = 57.29MHz for V=75.01Hz */
+};
+#endif
+
+/* Register values for 640x480, 67Hz mode (6) */
+static struct aty_regvals aty_gx_reg_init_6 = {
+	{ 0x200, 0x200, 0x200 },
+
+	{ 0x28005b, 0x280059, 0x280058 },
+	{ 0x3040200, 0x3060300, 0x30c0600 },
+	{ 0x2002312, 0x3002312, 0x6002312 },
+
+	0x4f006b, 0x1df020c, 0x2301e2, 0x14100040,
+        { 0x35, 0x07 }
+};
+
+#if 0		/* not filled in yet */
+/* Register values for 640x480, 60Hz mode (5) */
+static struct aty_regvals aty_gx_reg_init_5 = {
+	{ 0x200, 0x200, 0x200 },
+	{ },
+        { 0x35, 0x07 }
+};
+#endif
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/ati-vt.h m68k-2.1.72/drivers/video/ati-vt.h
--- m68k-2.1.72-status/drivers/video/ati-vt.h	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/ati-vt.h	Wed Jan  7 22:03:26 1998
@@ -0,0 +1,147 @@
+/* Register values for 1280x1024, 60Hz mode (20) */
+static struct aty_regvals aty_vt_reg_init_20 = {
+  { 0, 0, 0 },
+     
+  { 0x002e02a7, 0x002e02a7, 0 },
+  { 0x03070200, 0x03070200, 0 },
+  { 0x0a00cb22, 0x0b00cb23, 0 },
+     
+    0x009f00d2, 0x03ff0429, 0x00030400, 0x28000000,
+  { 0x00, 0xaa }
+};
+
+/* Register values for 1280x960, 75Hz mode (19) */
+static struct aty_regvals aty_vt_reg_init_19 = {
+  { 0, 0, 0 },
+  { 0x003202a3, 0x003201a2, 0 },
+  { 0x030b0200, 0x030b0300, 0 },
+  { 0x0a00cb22, 0x0b00cb23, 0 },
+
+    0x009f00d1, 0x03bf03e7, 0x000303c0, 0x28000000,
+  { 0x00, 0xc6 }
+};
+
+/* Register values for 1152x870, 75Hz mode (18) */
+static struct aty_regvals aty_vt_reg_init_18 = {
+  { 0, 0, 0 },
+     
+  { 0x00300295, 0x00300194, 0 },
+  { 0x03080200, 0x03080300, 0 },
+  { 0x0a00cb21, 0x0b00cb22, 0 },
+     
+    0x008f00b5, 0x03650392, 0x00230368, 0x24000000,
+  { 0x00, 0x9d }
+};
+
+/* Register values for 1024x768, 75Hz mode (17) */
+static struct aty_regvals aty_vt_reg_init_17 = {
+  { 0, 0, 0 },
+
+  { 0x002c0283, 0x002c0182, 0 },
+  { 0x03080200, 0x03080300, 0 },
+  { 0x0a00cb21, 0x0b00cb22, 0 },
+     
+    0x007f00a3, 0x02ff031f, 0x00030300, 0x20000000,
+  { 0x01, 0xf7 }
+};
+
+/* Register values for 1024x768, 70Hz mode (15) */
+static struct aty_regvals aty_vt_reg_init_15 = {
+  { 0, 0, 0 },
+  { 0x00310284, 0x00310183, 0 },
+  { 0x03080200, 0x03080300, 0 },
+  { 0x0a00cb21, 0x0b00cb22, 0 },
+
+    0x007f00a5, 0x02ff0325, 0x00260302, 0x20000000,
+  { 0x01, 0xeb }
+};    
+
+/* Register values for 1024x768, 60Hz mode (14) */
+static struct aty_regvals aty_vt_reg_init_14 = {
+  { 0, 0, 0 },
+     
+  { 0x00310284, 0x00310183, 0x00310582 }, /* 32 bit 0x00310582 */
+  { 0x03080200, 0x03080300, 0x03070600 }, /* 32 bit 0x03070600 */
+  { 0x0a00cb21, 0x0b00cb22, 0x0e00cb23 },
+    
+    0x007f00a7, 0x02ff0325, 0x00260302, 0x20000000,
+  { 0x01, 0xcc }
+};  
+
+/* Register values for 832x624, 75Hz mode (13) */
+static struct aty_regvals aty_vt_reg_init_13 = {
+  { 0, 0, 0 },
+
+  { 0x0028026d, 0x0028016c, 0x0028056b },
+  { 0x03080200, 0x03070300, 0x03090600 },
+  { 0x0a00cb21, 0x0b00cb21, 0x0e00cb22 },
+
+    0x0067008f, 0x026f029a, 0x00230270, 0x1a000000,
+  { 0x01, 0xb4 }
+};
+
+/* Register values for 800x600, 75Hz mode (12) */
+static struct aty_regvals aty_vt_reg_init_12 = {
+  { 0, 0, 0 },
+     
+  { 0x002a0267, 0x002a0166, 0x002a0565 },
+  { 0x03040200, 0x03060300, 0x03070600 },
+  { 0x0a00cb21, 0x0b00cb21, 0x0e00cb22 },
+     
+    0x00630083, 0x02570270, 0x00030258, 0x19000000,
+  { 0x01, 0x9c }
+};
+
+/* Register values for 800x600, 72Hz mode (11) */
+static struct aty_regvals aty_vt_reg_init_11 = {
+  { 0, 0, 0 },
+     
+  { 0x002f026c, 0x002f016b, 0x002f056a },
+  { 0x03050200, 0x03070300, 0x03090600 },
+  { 0x0a00cb21, 0x0b00cb21, 0x0e00cb22 },
+
+    0x00630081, 0x02570299, 0x0006027c, 0x19000000,
+  { 0x01, 0x9d }
+};
+
+/* Register values for 800x600, 60Hz mode (10) */
+static struct aty_regvals aty_vt_reg_init_10 = {
+  { 0, 0, 0 },
+     
+  { 0x0030026a, 0x00300169, 0x00300568 },
+  { 0x03050200, 0x03070300, 0x03090600 },
+  { 0x0a00cb21, 0x0b00cb21, 0x0e00cb22 },
+     
+    0x00630083, 0x02570273, 0x00040258, 0x19000000,
+  { 0x02, 0xfb }
+};
+
+/* Register values for 640x480, 67Hz mode (6) */
+static struct aty_regvals aty_vt_reg_init_6 = {
+  { 0, 0, 0 },
+      
+  { 0x00280259, 0x00280158, 0x00280557 },
+  { 0x03050200, 0x03070300, 0x030a0600 },
+  { 0x0a00cb21, 0x0b00cb21, 0x0e00cb22 },
+      
+    0x004f006b, 0x01df020c, 0x002301e2, 0x14000000,
+  { 0x02, 0xbe }
+};
+
+/* Register values for 640x480, 60Hz mode (5) */
+static struct aty_regvals aty_vt_reg_init_5 = {
+  { 0, 0, 0 },
+      
+  { 0x002c0253, 0x002c0152, 0x002c0551 },
+  { 0x03050200, 0x03070300, 0x03090600 },
+  { 0x0a00cb21, 0x0b00cb21, 0x0e00cb22 },
+
+    0x004f0063, 0x01df020c, 0x002201e9, 0x14000000,
+  { 0x02, 0x9e }
+};
+                               /*     8 bit       15 bit      32 bit   */
+static int vt_mem_cntl[3][3] = { { 0x0A00CB21, 0x0B00CB21, 0x0E00CB21 },  /* 1 MB VRAM */
+                                 { 0x0A00CB22, 0x0B00CB22, 0x0E00CB22 },  /* 2 MB VRAM */
+                                { 0x0200053B, 0x0300053B, 0x0600053B }   /* 4 M B VRAM */
+ };
+
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/aty.h m68k-2.1.72/drivers/video/aty.h
--- m68k-2.1.72-status/drivers/video/aty.h	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/aty.h	Wed Jan  7 22:03:26 1998
@@ -0,0 +1,908 @@
+/*
+ * Exported procedures for the ATI/mach64 display driver on PowerMacs.
+ *
+ * Copyright (C) 1997 Michael AK Tesch
+ *  written with much help from Jon Howell
+ *
+ * Updated for 3D RAGE PRO by Geert Uytterhoeven
+ *	
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+/*
+ * most of the rest of this file comes from ATI sample code
+ */
+#ifndef REGMACH64_H
+#define REGMACH64_H
+
+/* NON-GUI MEMORY MAPPED Registers - expressed in BYTE offsets */
+
+#define CRTC_H_TOTAL_DISP	0x0000	/* Dword offset 0_00 */
+#define CRTC_H_SYNC_STRT_WID	0x0004	/* Dword offset 0_01 */
+#define CRTC_H_SYNC_STRT	0x0004
+#define CRTC_H_SYNC_DLY		0x0005
+#define CRTC_H_SYNC_WID		0x0006
+
+#define CRTC_V_TOTAL_DISP	0x0008	/* Dword offset 0_02 */
+#define CRTC_V_TOTAL		0x0008
+#define CRTC_V_DISP		0x000A
+#define CRTC_V_SYNC_STRT_WID	0x000C	/* Dword offset 0_03 */
+#define CRTC_V_SYNC_STRT	0x000C
+#define CRTC_V_SYNC_WID		0x000E
+
+#define CRTC_VLINE_CRNT_VLINE	0x0010	/* Dword offset 0_04 */
+#define CRTC_OFF_PITCH		0x0014	/* Dword offset 0_05 */
+#define CRTC_OFFSET		0x0014
+#define CRTC_PITCH		0x0016
+
+#define CRTC_INT_CNTL		0x0018	/* Dword offset 0_06 */
+#define CRTC_GEN_CNTL		0x001C	/* Dword offset 0_07 */
+#define CRTC_PIX_WIDTH		0x001D
+#define CRTC_FIFO		0x001E
+#define CRTC_EXT_DISP		0x001F
+
+#define DSP_CONFIG		0x0020	/* Dword offset 0_08 */
+#define DSP_ON_OFF		0x0024	/* Dword offset 0_09 */
+#define TIMER_CONFIG		0x0028	/* Dword offset 0_0A */
+#define MEM_BUF_CNTL		0x002C	/* Dword offset 0_0B */
+#define MEM_ADDR_CONFIG		0x0034	/* Dword offset 0_0D */
+
+#define CRT_TRAP		0x0038	/* Dword offset 0_0E */
+
+#define I2C_CNTL_0		0x003C	/* Dword offset 0_0F */
+
+#define OVR_CLR			0x0040	/* Dword offset 0_10 */
+#define OVR_WID_LEFT_RIGHT	0x0044	/* Dword offset 0_11 */
+#define OVR_WID_TOP_BOTTOM	0x0048	/* Dword offset 0_12 */
+
+#define VGA_DSP_CONFIG		0x004C	/* Dword offset 0_13 */
+#define VGA_DSP_ON_OFF		0x0050	/* Dword offset 0_14 */
+
+#define CUR_CLR0		0x0060	/* Dword offset 0_18 */
+#define CUR_CLR1		0x0064	/* Dword offset 0_19 */
+#define CUR_OFFSET		0x0068	/* Dword offset 0_1A */
+#define CUR_HORZ_VERT_POSN	0x006C	/* Dword offset 0_1B */
+#define CUR_HORZ_VERT_OFF	0x0070	/* Dword offset 0_1C */
+
+#define GP_IO			0x0078	/* Dword offset 0_1E */
+
+#define HW_DEBUG		0x007C	/* Dword offset 0_1F */
+
+#define SCRATCH_REG0		0x0080	/* Dword offset 0_20 */
+#define SCRATCH_REG1		0x0084	/* Dword offset 0_21 */
+
+#define CLOCK_CNTL		0x0090	/* Dword offset 0_24 */
+#define CLOCK_SEL_CNTL		0x0090	/* Dword offset 0_24 */
+
+#define CONFIG_STAT1		0x0094	/* Dword offset 0_25 */
+#define CONFIG_STAT2		0x0098	/* Dword offset 0_26 */
+
+#define BUS_CNTL		0x00A0	/* Dword offset 0_28 */
+
+#define EXT_MEM_CNTL		0x00AC	/* Dword offset 0_2B */
+#define MEM_CNTL		0x00B0	/* Dword offset 0_2C */
+
+#define MEM_VGA_WP_SEL		0x00B4	/* Dword offset 0_2D */
+#define MEM_VGA_RP_SEL		0x00B8	/* Dword offset 0_2E */
+
+#define DAC_REGS		0x00C0	/* Dword offset 0_30 */
+#define DAC_W_INDEX		0x00C0	/* Dword offset 0_30 */
+#define DAC_DATA		0x00C1	/* Dword offset 0_30 */
+#define DAC_MASK		0x00C2	/* Dword offset 0_30 */
+#define DAC_R_INDEX		0x00C3	/* Dword offset 0_30 */
+#define DAC_CNTL		0x00C4	/* Dword offset 0_31 */
+
+#define EXT_DAC_REGS		0x00C8	/* Dword offset 0_32 */
+
+#define GEN_TEST_CNTL		0x00D0	/* Dword offset 0_34 */
+
+#define CUSTOM_MACRO_CNTL	0x00D4	/* Dword offset 0_35 */
+
+#define CONFIG_CNTL		0x00DC	/* Dword offset 0_37 (CT, ET, VT) */
+#define CONFIG_CHIP_ID		0x00E0	/* Dword offset 0_38 */
+#define CONFIG_STAT0		0x00E4	/* Dword offset 0_39 */
+#define CRC_SIG			0x00E8	/* Dword offset 0_3A */
+
+
+/* GUI MEMORY MAPPED Registers */
+
+#define DST_OFF_PITCH		0x0100	/* Dword offset 0_40 */
+#define DST_X			0x0104	/* Dword offset 0_41 */
+#define DST_Y			0x0108	/* Dword offset 0_42 */
+#define DST_Y_X			0x010C	/* Dword offset 0_43 */
+#define DST_WIDTH		0x0110	/* Dword offset 0_44 */
+#define DST_HEIGHT		0x0114	/* Dword offset 0_45 */
+#define DST_HEIGHT_WIDTH	0x0118	/* Dword offset 0_46 */
+#define DST_X_WIDTH		0x011C	/* Dword offset 0_47 */
+#define DST_BRES_LNTH		0x0120	/* Dword offset 0_48 */
+#define DST_BRES_ERR		0x0124	/* Dword offset 0_49 */
+#define DST_BRES_INC		0x0128	/* Dword offset 0_4A */
+#define DST_BRES_DEC		0x012C	/* Dword offset 0_4B */
+#define DST_CNTL		0x0134	/* Dword offset 0_4C */
+#define DST_Y_X__ALIAS__	0x0138	/* Dword offset 0_4D */
+#define TRAIL_BRES_ERR		0x013C	/* Dword offset 0_4E */
+#define TRAIL_BRES_INC		0x0140	/* Dword offset 0_4F */
+#define TRAIL_BRES_DEC		0x0144	/* Dword offset 0_50 */
+#define LEAD_BRES_LNTH		0x0148	/* Dword offset 0_51 */
+#define Z_OFF_PITCH		0x014C	/* Dword offset 0_52 */
+#define Z_CNTL			0x0150	/* Dword offset 0_53 */
+#define ALPHA_TST_CNTL		0x0154	/* Dword offset 0_54 */
+#define SECONDARY_STW_EXP	0x0158	/* Dword offset 0_56 */
+#define SECONDARY_S_X_INC	0x015C	/* Dword offset 0_57 */
+#define SECONDARY_S_Y_INC	0x0160	/* Dword offset 0_58 */
+#define SECONDARY_S_START	0x0164	/* Dword offset 0_59 */
+#define SECONDARY_W_X_INC	0x0168	/* Dword offset 0_5A */
+#define SECONDARY_W_Y_INC	0x016C	/* Dword offset 0_5B */
+#define SECONDARY_W_START	0x0170	/* Dword offset 0_5C */
+#define SECONDARY_T_X_INC	0x0174	/* Dword offset 0_5D */
+#define SECONDARY_T_Y_INC	0x0178	/* Dword offset 0_5E */
+#define SECONDARY_T_START	0x017C	/* Dword offset 0_5F */
+
+#define SRC_OFF_PITCH		0x0180	/* Dword offset 0_60 */
+#define SRC_X			0x0184	/* Dword offset 0_61 */
+#define SRC_Y			0x0188	/* Dword offset 0_62 */
+#define SRC_Y_X			0x018C	/* Dword offset 0_63 */
+#define SRC_WIDTH1		0x0190	/* Dword offset 0_64 */
+#define SRC_HEIGHT1		0x0194	/* Dword offset 0_65 */
+#define SRC_HEIGHT1_WIDTH1	0x0198	/* Dword offset 0_66 */
+#define SRC_X_START		0x019C	/* Dword offset 0_67 */
+#define SRC_Y_START		0x01A0	/* Dword offset 0_68 */
+#define SRC_Y_X_START		0x01A4	/* Dword offset 0_69 */
+#define SRC_WIDTH2		0x01A8	/* Dword offset 0_6A */
+#define SRC_HEIGHT2		0x01AC	/* Dword offset 0_6B */
+#define SRC_HEIGHT2_WIDTH2	0x01B0	/* Dword offset 0_6C */
+#define SRC_CNTL		0x01B4	/* Dword offset 0_6D */
+
+#define SCALE_OFF		0x01C0	/* Dword offset 0_70 */
+#define SECONDARY_SCALE_OFF	0x01C4	/* Dword offset 0_71 */
+
+#define TEX_0_OFF		0x01C0	/* Dword offset 0_70 */
+#define TEX_1_OFF		0x01C4	/* Dword offset 0_71 */
+#define TEX_2_OFF		0x01C8	/* Dword offset 0_72 */
+#define TEX_3_OFF		0x01CC	/* Dword offset 0_73 */
+#define TEX_4_OFF		0x01D0	/* Dword offset 0_74 */
+#define TEX_5_OFF		0x01D4	/* Dword offset 0_75 */
+#define TEX_6_OFF		0x01D8	/* Dword offset 0_76 */
+#define TEX_7_OFF		0x01DC	/* Dword offset 0_77 */
+
+#define SCALE_WIDTH		0x01DC	/* Dword offset 0_77 */
+#define SCALE_HEIGHT		0x01E0	/* Dword offset 0_78 */
+
+#define TEX_8_OFF		0x01E0	/* Dword offset 0_78 */
+#define TEX_9_OFF		0x01E4	/* Dword offset 0_79 */
+#define TEX_10_OFF		0x01E8	/* Dword offset 0_7A */
+#define S_Y_INC			0x01EC	/* Dword offset 0_7B */
+
+#define SCALE_PITCH		0x01EC	/* Dword offset 0_7B */
+#define SCALE_X_INC		0x01F0	/* Dword offset 0_7C */
+
+#define RED_X_INC		0x01F0	/* Dword offset 0_7C */
+#define GREEN_X_INC		0x01F4	/* Dword offset 0_7D */
+
+#define SCALE_Y_INC		0x01F4	/* Dword offset 0_7D */
+#define SCALE_VACC		0x01F8	/* Dword offset 0_7E */
+#define SCALE_3D_CNTL		0x01FC	/* Dword offset 0_7F */
+
+#define HOST_DATA0		0x0200	/* Dword offset 0_80 */
+#define HOST_DATA1		0x0204	/* Dword offset 0_81 */
+#define HOST_DATA2		0x0208	/* Dword offset 0_82 */
+#define HOST_DATA3		0x020C	/* Dword offset 0_83 */
+#define HOST_DATA4		0x0210	/* Dword offset 0_84 */
+#define HOST_DATA5		0x0214	/* Dword offset 0_85 */
+#define HOST_DATA6		0x0218	/* Dword offset 0_86 */
+#define HOST_DATA7		0x021C	/* Dword offset 0_87 */
+#define HOST_DATA8		0x0220	/* Dword offset 0_88 */
+#define HOST_DATA9		0x0224	/* Dword offset 0_89 */
+#define HOST_DATAA		0x0228	/* Dword offset 0_8A */
+#define HOST_DATAB		0x022C	/* Dword offset 0_8B */
+#define HOST_DATAC		0x0230	/* Dword offset 0_8C */
+#define HOST_DATAD		0x0234	/* Dword offset 0_8D */
+#define HOST_DATAE		0x0238	/* Dword offset 0_8E */
+#define HOST_DATAF		0x023C	/* Dword offset 0_8F */
+#define HOST_CNTL		0x0240	/* Dword offset 0_90 */
+
+#define BM_HOSTDATA		0x0244	/* Dword offset 0_91 */
+#define BM_ADDR			0x0248	/* Dword offset 0_92 */
+#define BM_DATA			0x0248	/* Dword offset 0_92 */
+#define BM_GUI_TABLE_CMD	0x024C	/* Dword offset 0_93 */
+
+#define PAT_REG0		0x0280	/* Dword offset 0_A0 */
+#define PAT_REG1		0x0284	/* Dword offset 0_A1 */
+#define PAT_CNTL		0x0288	/* Dword offset 0_A2 */
+
+#define SC_LEFT			0x02A0	/* Dword offset 0_A8 */
+#define SC_RIGHT		0x02A4	/* Dword offset 0_A9 */
+#define SC_LEFT_RIGHT		0x02A8	/* Dword offset 0_AA */
+#define SC_TOP			0x02AC	/* Dword offset 0_AB */
+#define SC_BOTTOM		0x02B0	/* Dword offset 0_AC */
+#define SC_TOP_BOTTOM		0x02B4	/* Dword offset 0_AD */
+
+#define DP_BKGD_CLR		0x02C0	/* Dword offset 0_B0 */
+#define DP_FOG_CLR		0x02C4	/* Dword offset 0_B1 */
+#define DP_FRGD_CLR		0x02C4	/* Dword offset 0_B1 */
+#define DP_WRITE_MSK		0x02C8	/* Dword offset 0_B2 */
+#define DP_CHAIN_MSK		0x02CC	/* Dword offset 0_B3 */
+#define DP_PIX_WIDTH		0x02D0	/* Dword offset 0_B4 */
+#define DP_MIX			0x02D4	/* Dword offset 0_B5 */
+#define DP_SRC			0x02D8	/* Dword offset 0_B6 */
+#define DP_FRGD_CLR_MIX		0x02DC	/* Dword offset 0_B7 */
+#define DP_FRGD_BLGD_CLR	0x02E0	/* Dword offset 0_B8 */
+
+#define DST_X_Y			0x02E8	/* Dword offset 0_BA */
+#define DST_WIDTH_HEIGHT	0x02EC	/* Dword offset 0_BB */
+#define USR_DST_PICTH		0x02F0	/* Dword offset 0_BC */
+#define DP_SET_GUI_ENGINE2	0x02F8	/* Dword offset 0_BE */
+#define DP_SET_GUI_ENGINE	0x02FC	/* Dword offset 0_BF */
+
+#define CLR_CMP_CLR		0x0300	/* Dword offset 0_C0 */
+#define CLR_CMP_MSK		0x0304	/* Dword offset 0_C1 */
+#define CLR_CMP_CNTL		0x0308	/* Dword offset 0_C2 */
+
+#define FIFO_STAT		0x0310	/* Dword offset 0_C4 */
+
+#define CONTEXT_MASK		0x0320	/* Dword offset 0_C8 */
+#define CONTEXT_LOAD_CNTL	0x032C	/* Dword offset 0_CB */
+
+#define GUI_TRAJ_CNTL		0x0330	/* Dword offset 0_CC */
+#define GUI_STAT		0x0338	/* Dword offset 0_CE */
+
+#define TEX_PALETTE_INDEX	0x0340	/* Dword offset 0_D0 */
+#define STW_EXP			0x0344	/* Dword offset 0_D1 */
+#define LOG_MAX_INC		0x0348	/* Dword offset 0_D2 */
+#define S_X_INC			0x034C	/* Dword offset 0_D3 */
+#define S_Y_INC__ALIAS__	0x0350	/* Dword offset 0_D4 */
+
+#define SCALE_PITCH__ALIAS__	0x0350	/* Dword offset 0_D4 */
+
+#define S_START			0x0354	/* Dword offset 0_D5 */
+#define W_X_INC			0x0358	/* Dword offset 0_D6 */
+#define W_Y_INC			0x035C	/* Dword offset 0_D7 */
+#define W_START			0x0360	/* Dword offset 0_D8 */
+#define T_X_INC			0x0364	/* Dword offset 0_D9 */
+#define T_Y_INC			0x0368	/* Dword offset 0_DA */
+
+#define SECONDARY_SCALE_PITCH	0x0368	/* Dword offset 0_DA */
+
+#define T_START			0x036C	/* Dword offset 0_DB */
+#define TEX_SIZE_PITCH		0x0370	/* Dword offset 0_DC */
+#define TEX_CNTL		0x0374	/* Dword offset 0_DD */
+#define SECONDARY_TEX_OFFSET	0x0378	/* Dword offset 0_DE */
+#define TEX_PALETTE		0x037C	/* Dword offset 0_DF */
+
+#define SCALE_PITCH_BOTH	0x0380	/* Dword offset 0_E0 */
+#define SECONDARY_SCALE_OFF_ACC	0x0384	/* Dword offset 0_E1 */
+#define SCALE_OFF_ACC		0x0388	/* Dword offset 0_E2 */
+#define SCALE_DST_Y_X		0x038C	/* Dword offset 0_E3 */
+
+#define COMPOSITE_SHADOW_ID	0x0398	/* Dword offset 0_E6 */
+
+#define SECONDARY_SCALE_X_INC	0x039C	/* Dword offset 0_E7 */
+
+#define SPECULAR_RED_X_INC	0x039C	/* Dword offset 0_E7 */
+#define SPECULAR_RED_Y_INC	0x03A0	/* Dword offset 0_E8 */
+#define SPECULAR_RED_START	0x03A4	/* Dword offset 0_E9 */
+
+#define SECONDARY_SCALE_HACC	0x03A4	/* Dword offset 0_E9 */
+
+#define SPECULAR_GREEN_X_INC	0x03A8	/* Dword offset 0_EA */
+#define SPECULAR_GREEN_Y_INC	0x03AC	/* Dword offset 0_EB */
+#define SPECULAR_GREEN_START	0x03B0	/* Dword offset 0_EC */
+#define SPECULAR_BLUE_X_INC	0x03B4	/* Dword offset 0_ED */
+#define SPECULAR_BLUE_Y_INC	0x03B8	/* Dword offset 0_EE */
+#define SPECULAR_BLUE_START	0x03BC	/* Dword offset 0_EF */
+
+#define SCALE_X_INC__ALIAS__	0x03C0	/* Dword offset 0_F0 */
+
+#define RED_X_INC__ALIAS__	0x03C0	/* Dword offset 0_F0 */
+#define RED_Y_INC		0x03C4	/* Dword offset 0_F1 */
+#define RED_START		0x03C8	/* Dword offset 0_F2 */
+
+#define SCALE_HACC		0x03C8	/* Dword offset 0_F2 */
+#define SCALE_Y_INC__ALIAS__	0x03CC	/* Dword offset 0_F3 */
+
+#define GREEN_X_INC__ALIAS__	0x03CC	/* Dword offset 0_F3 */
+#define GREEN_Y_INC		0x03D0	/* Dword offset 0_F4 */
+
+#define SECONDARY_SCALE_Y_INC	0x03D0	/* Dword offset 0_F4 */
+#define SECONDARY_SCALE_VACC	0x03D4	/* Dword offset 0_F5 */
+
+#define GREEN_START		0x03D4	/* Dword offset 0_F5 */
+#define BLUE_X_INC		0x03D8	/* Dword offset 0_F6 */
+#define BLUE_Y_INC		0x03DC	/* Dword offset 0_F7 */
+#define BLUE_START		0x03E0	/* Dword offset 0_F8 */
+#define Z_X_INC			0x03E4	/* Dword offset 0_F9 */
+#define Z_Y_INC			0x03E8	/* Dword offset 0_FA */
+#define Z_START			0x03EC	/* Dword offset 0_FB */
+#define ALPHA_X_INC		0x03F0	/* Dword offset 0_FC */
+#define FOG_X_INC		0x03F0	/* Dword offset 0_FC */
+#define ALPHA_Y_INC		0x03F4	/* Dword offset 0_FD */
+#define FOG_Y_INC		0x03F4	/* Dword offset 0_FD */
+#define ALPHA_START		0x03F8	/* Dword offset 0_FE */
+#define FOG_START		0x03F8	/* Dword offset 0_FE */
+
+#define OVERLAY_Y_X_START		0x0400	/* Dword offset 1_00 */
+#define OVERLAY_Y_X_END			0x0404	/* Dword offset 1_01 */
+#define OVERLAY_VIDEO_KEY_CLR		0x0408	/* Dword offset 1_02 */
+#define OVERLAY_VIDEO_KEY_MSK		0x040C	/* Dword offset 1_03 */
+#define OVERLAY_GRAPHICS_KEY_CLR	0x0410	/* Dword offset 1_04 */
+#define OVERLAY_GRAPHICS_KEY_MSK	0x0414	/* Dword offset 1_05 */
+#define OVERLAY_KEY_CNTL		0x0418	/* Dword offset 1_06 */
+
+#define OVERLAY_SCALE_INC	0x0420	/* Dword offset 1_08 */
+#define OVERLAY_SCALE_CNTL	0x0424	/* Dword offset 1_09 */
+#define SCALER_HEIGHT_WIDTH	0x0428	/* Dword offset 1_0A */
+#define SCALER_TEST		0x042C	/* Dword offset 1_0B */
+#define SCALER_BUF0_OFFSET	0x0434	/* Dword offset 1_0D */
+#define SCALER_BUF1_OFFSET	0x0438	/* Dword offset 1_0E */
+#define SCALE_BUF_PITCH		0x043C	/* Dword offset 1_0F */
+
+#define CAPTURE_START_END	0x0440	/* Dword offset 1_10 */
+#define CAPTURE_X_WIDTH		0x0444	/* Dword offset 1_11 */
+#define VIDEO_FORMAT		0x0448	/* Dword offset 1_12 */
+#define VBI_START_END		0x044C	/* Dword offset 1_13 */
+#define CAPTURE_CONFIG		0x0450	/* Dword offset 1_14 */
+#define TRIG_CNTL		0x0454	/* Dword offset 1_15 */
+
+#define OVERLAY_EXCLUSIVE_HORZ	0x0458	/* Dword offset 1_16 */
+#define OVERLAY_EXCLUSIVE_VERT	0x045C	/* Dword offset 1_17 */
+
+#define VAL_WIDTH		0x0460	/* Dword offset 1_18 */
+#define CAPTURE_DEBUG		0x0464	/* Dword offset 1_19 */
+#define VIDEO_SYNC_TEST		0x0468	/* Dword offset 1_1A */
+
+#define SNAPSHOT_VH_COUNTS	0x0470	/* Dword offset 1_1C */
+#define SNAPSHOT_F_COUNT	0x0474	/* Dword offset 1_1D */
+#define N_VIF_COUNT		0x0478	/* Dword offset 1_1E */
+#define SNAPSHOT_VIF_COUNT	0x047C	/* Dword offset 1_1F */
+
+#define CAPTURE_BUF0_OFFSET	0x0480	/* Dword offset 1_20 */
+#define CAPTURE_BUF1_OFFSET	0x0484	/* Dword offset 1_21 */
+#define CAPTURE_BUF_PITCH	0x0488	/* Dword offset 1_22 */
+
+#define MPP_CONFIG		0x04C0	/* Dword offset 1_30 */
+#define MPP_STROBE_SEQ		0x04C4	/* Dword offset 1_31 */
+#define MPP_ADDR		0x04C8	/* Dword offset 1_32 */
+#define MPP_DATA		0x04CC	/* Dword offset 1_33 */
+#define TVO_CNTL		0x0500	/* Dword offset 1_40 */
+
+#define CRT_HORZ_VERT_LOAD	0x0544	/* Dword offset 1_51 */
+
+#define AGP_BASE		0x0548	/* Dword offset 1_52 */
+#define AGP_CNTL		0x054C	/* Dword offset 1_53 */
+
+#define SCALER_COLOUR_CNTL	0x0550	/* Dword offset 1_54 */
+#define SCALER_H_COEFF0		0x0554	/* Dword offset 1_55 */
+#define SCALER_H_COEFF1		0x0558	/* Dword offset 1_56 */
+#define SCALER_H_COEFF2		0x055C	/* Dword offset 1_57 */
+#define SCALER_H_COEFF3		0x0560	/* Dword offset 1_58 */
+#define SCALER_H_COEFF4		0x0564	/* Dword offset 1_59 */
+
+#define GUI_CNTL		0x0578	/* Dword offset 1_5E */
+
+#define BM_FRAME_BUF_OFFSET	0x0580	/* Dword offset 1_60 */
+#define BM_SYSTEM_MEM_ADDR	0x0584	/* Dword offset 1_61 */
+#define BM_COMMAND		0x0588	/* Dword offset 1_62 */
+#define BM_STATUS		0x058C	/* Dword offset 1_63 */
+#define BM_GUI_TABLE		0x05B8	/* Dword offset 1_6E */
+#define BM_SYSTEM_TABLE		0x05BC	/* Dword offset 1_6F */
+
+#define SCALER_BUF0_OFFSET_U	0x05D4	/* Dword offset 1_75 */
+#define SCALER_BUF0_OFFSET_V	0x05D8	/* Dword offset 1_76 */
+#define SCALER_BUF1_OFFSET_U	0x05DC	/* Dword offset 1_77 */
+#define SCALER_BUF1_OFFSET_V	0x05E0	/* Dword offset 1_78 */
+
+#define VERTEX_1_S		0x0640	/* Dword offset 1_90 */
+#define VERTEX_1_T		0x0644	/* Dword offset 1_91 */
+#define VERTEX_1_W		0x0648	/* Dword offset 1_92 */
+#define VERTEX_1_SPEC_ARGB	0x064C	/* Dword offset 1_93 */
+#define VERTEX_1_Z		0x0650	/* Dword offset 1_94 */
+#define VERTEX_1_ARGB		0x0654	/* Dword offset 1_95 */
+#define VERTEX_1_X_Y		0x0658	/* Dword offset 1_96 */
+#define ONE_OVER_AREA		0x065C	/* Dword offset 1_97 */
+#define VERTEX_2_S		0x0660	/* Dword offset 1_98 */
+#define VERTEX_2_T		0x0664	/* Dword offset 1_99 */
+#define VERTEX_2_W		0x0668	/* Dword offset 1_9A */
+#define VERTEX_2_SPEC_ARGB	0x066C	/* Dword offset 1_9B */
+#define VERTEX_2_Z		0x0670	/* Dword offset 1_9C */
+#define VERTEX_2_ARGB		0x0674	/* Dword offset 1_9D */
+#define VERTEX_2_X_Y		0x0678	/* Dword offset 1_9E */
+#define ONE_OVER_AREA		0x065C	/* Dword offset 1_9F */
+#define VERTEX_3_S		0x0680	/* Dword offset 1_A0 */
+#define VERTEX_3_T		0x0684	/* Dword offset 1_A1 */
+#define VERTEX_3_W		0x0688	/* Dword offset 1_A2 */
+#define VERTEX_3_SPEC_ARGB	0x068C	/* Dword offset 1_A3 */
+#define VERTEX_3_Z		0x0690	/* Dword offset 1_A4 */
+#define VERTEX_3_ARGB		0x0694	/* Dword offset 1_A5 */
+#define VERTEX_3_X_Y		0x0698	/* Dword offset 1_A6 */
+#define ONE_OVER_AREA		0x065C	/* Dword offset 1_A7 */
+#define VERTEX_1_S		0x0640	/* Dword offset 1_AB */
+#define VERTEX_1_T		0x0644	/* Dword offset 1_AC */
+#define VERTEX_1_W		0x0648	/* Dword offset 1_AD */
+#define VERTEX_2_S		0x0660	/* Dword offset 1_AE */
+#define VERTEX_2_T		0x0664	/* Dword offset 1_AF */
+#define VERTEX_2_W		0x0668	/* Dword offset 1_B0 */
+#define VERTEX_3_SECONDARY_S	0x06C0	/* Dword offset 1_B0 */
+#define VERTEX_3_S		0x0680	/* Dword offset 1_B1 */
+#define VERTEX_3_SECONDARY_T	0x06C4	/* Dword offset 1_B1 */
+#define VERTEX_3_T		0x0684	/* Dword offset 1_B2 */
+#define VERTEX_3_SECONDARY_W	0x06C8	/* Dword offset 1_B2 */
+#define VERTEX_3_W		0x0688	/* Dword offset 1_B3 */
+#define VERTEX_1_SPEC_ARGB	0x064C	/* Dword offset 1_B4 */
+#define VERTEX_2_SPEC_ARGB	0x066C	/* Dword offset 1_B5 */
+#define VERTEX_3_SPEC_ARGB	0x068C	/* Dword offset 1_B6 */
+#define VERTEX_1_Z		0x0650	/* Dword offset 1_B7 */
+#define VERTEX_2_Z		0x0670	/* Dword offset 1_B8 */
+#define VERTEX_3_Z		0x0690	/* Dword offset 1_B9 */
+#define VERTEX_1_ARGB		0x0654	/* Dword offset 1_BA */
+#define VERTEX_2_ARGB		0x0674	/* Dword offset 1_BB */
+#define VERTEX_3_ARGB		0x0694	/* Dword offset 1_BC */
+#define VERTEX_1_X_Y		0x0658	/* Dword offset 1_BD */
+#define VERTEX_2_X_Y		0x0678	/* Dword offset 1_BE */
+#define VERTEX_3_X_Y		0x0698	/* Dword offset 1_BF */
+#define ONE_OVER_AREA_UC	0x0700	/* Dword offset 1_C0 */
+#define SETUP_CNTL		0x0704	/* Dword offset 1_C1 */
+#define VERTEX_1_SECONDARY_S	0x0728	/* Dword offset 1_CA */
+#define VERTEX_1_SECONDARY_T	0x072C	/* Dword offset 1_CB */
+#define VERTEX_1_SECONDARY_W	0x0730	/* Dword offset 1_CC */
+#define VERTEX_2_SECONDARY_S	0x0734	/* Dword offset 1_CD */
+#define VERTEX_2_SECONDARY_T	0x0738	/* Dword offset 1_CE */
+#define VERTEX_2_SECONDARY_W	0x073C	/* Dword offset 1_CF */
+
+
+/* CRTC control values (mostly CRTC_GEN_CNTL) */
+
+#define CRTC_H_SYNC_NEG		0x00200000
+#define CRTC_V_SYNC_NEG		0x00200000
+
+#define CRTC_DBL_SCAN_EN	0x00000001
+#define CRTC_INTERLACE_EN	0x00000002
+#define CRTC_HSYNC_DIS		0x00000004
+#define CRTC_VSYNC_DIS		0x00000008
+#define CRTC_CSYNC_EN		0x00000010
+#define CRTC_PIX_BY_2_EN	0x00000020
+#define CRTC_BLANK		0x00000040
+
+#define CRTC_PIX_WIDTH_MASK	0x00000700
+#define CRTC_PIX_WIDTH_4BPP	0x00000100
+#define CRTC_PIX_WIDTH_8BPP	0x00000200
+#define CRTC_PIX_WIDTH_15BPP	0x00000300
+#define CRTC_PIX_WIDTH_16BPP	0x00000400
+#define CRTC_PIX_WIDTH_24BPP	0x00000500
+#define CRTC_PIX_WIDTH_32BPP	0x00000600
+
+#define CRTC_BYTE_PIX_ORDER	0x00000800
+#define CRTC_PIX_ORDER_MSN_LSN	0x00000000
+#define CRTC_PIX_ORDER_LSN_MSN	0x00000800
+
+#define CRTC_FIFO_LWM		0x000f0000
+#define CRTC_EXT_DISP_EN	0x01000000
+#define CRTC_EXT_EN		0x02000000
+
+#define CRTC_CRNT_VLINE		0x07f00000
+#define CRTC_VBLANK		0x00000001
+
+
+/* DAC control values */
+
+#define DAC_EXT_SEL_RS2		0x01
+#define DAC_EXT_SEL_RS3		0x02
+#define DAC_8BIT_EN		0x00000100
+#define DAC_PIX_DLY_MASK	0x00000600
+#define DAC_PIX_DLY_0NS		0x00000000
+#define DAC_PIX_DLY_2NS		0x00000200
+#define DAC_PIX_DLY_4NS		0x00000400
+#define DAC_BLANK_ADJ_MASK	0x00001800
+#define DAC_BLANK_ADJ_0		0x00000000
+#define DAC_BLANK_ADJ_1		0x00000800
+#define DAC_BLANK_ADJ_2		0x00001000
+
+
+/* Mix control values */
+
+#define MIX_NOT_DST		0x0000
+#define MIX_0			0x0001
+#define MIX_1			0x0002
+#define MIX_DST			0x0003
+#define MIX_NOT_SRC		0x0004
+#define MIX_XOR			0x0005
+#define MIX_XNOR		0x0006
+#define MIX_SRC			0x0007
+#define MIX_NAND		0x0008
+#define MIX_NOT_SRC_OR_DST	0x0009
+#define MIX_SRC_OR_NOT_DST	0x000a
+#define MIX_OR			0x000b
+#define MIX_AND			0x000c
+#define MIX_SRC_AND_NOT_DST	0x000d
+#define MIX_NOT_SRC_AND_DST	0x000e
+#define MIX_NOR			0x000f
+
+/* Maximum engine dimensions */
+#define ENGINE_MIN_X		0
+#define ENGINE_MIN_Y		0
+#define ENGINE_MAX_X		4095
+#define ENGINE_MAX_Y		16383
+
+/* Mach64 engine bit constants - these are typically ORed together */
+
+/* BUS_CNTL register constants */
+#define BUS_FIFO_ERR_ACK	0x00200000
+#define BUS_HOST_ERR_ACK	0x00800000
+
+/* GEN_TEST_CNTL register constants */
+#define GEN_OVR_OUTPUT_EN	0x20
+#define HWCURSOR_ENABLE		0x80
+#define GUI_ENGINE_ENABLE	0x100
+#define BLOCK_WRITE_ENABLE	0x200
+
+/* DSP_CONFIG register constants */
+#define DSP_XCLKS_PER_QW	0x00003fff
+#define DSP_LOOP_LATENCY	0x000f0000
+#define DSP_PRECISION		0x00700000
+
+/* DSP_ON_OFF register constants */
+#define DSP_OFF			0x000007ff
+#define DSP_ON			0x07ff0000
+
+/* CLOCK_CNTL register constants */
+#define CLOCK_SEL		0x0f
+#define CLOCK_DIV		0x30
+#define CLOCK_DIV1		0x00
+#define CLOCK_DIV2		0x10
+#define CLOCK_DIV4		0x20
+#define CLOCK_STROBE		0x40
+#define PLL_WR_EN		0x02
+
+/* PLL registers */
+#define PLL_MACRO_CNTL		0x01
+#define PLL_REF_DIV		0x02
+#define PLL_GEN_CNTL		0x03
+#define MCLK_FB_DIV		0x04
+#define PLL_VCLK_CNTL		0x05
+#define VCLK_POST_DIV		0x06
+#define VCLK0_FB_DIV		0x07
+#define VCLK1_FB_DIV		0x08
+#define VCLK2_FB_DIV		0x09
+#define VCLK3_FB_DIV		0x0A
+#define PLL_XCLK_CNTL		0x0B
+#define PLL_TEST_CTRL		0x0E
+#define PLL_TEST_COUNT		0x0F
+
+/* Fields in PLL registers */
+#define PLL_PC_GAIN		0x07
+#define PLL_VC_GAIN		0x18
+#define PLL_DUTY_CYC		0xE0
+#define PLL_OVERRIDE		0x01
+#define PLL_MCLK_RST		0x02
+#define OSC_EN			0x04
+#define EXT_CLK_EN		0x08
+#define MCLK_SRC_SEL		0x70
+#define EXT_CLK_CNTL		0x80
+#define VCLK_SRC_SEL		0x03
+#define PLL_VCLK_RST		0x04
+#define VCLK_INVERT		0x08
+#define VCLK0_POST		0x03
+#define VCLK1_POST		0x0C
+#define VCLK2_POST		0x30
+#define VCLK3_POST		0xC0
+
+/* CONFIG_CNTL register constants */
+#define APERTURE_4M_ENABLE	1
+#define APERTURE_8M_ENABLE	2
+#define VGA_APERTURE_ENABLE	4
+
+/* CONFIG_STAT0 register constants (GX, CX) */
+#define CFG_BUS_TYPE		0x00000007
+#define CFG_MEM_TYPE		0x00000038
+#define CFG_INIT_DAC_TYPE	0x00000e00
+
+/* CONFIG_STAT0 register constants (CT, ET, VT) */
+#define CFG_MEM_TYPE_xT		0x00000007
+
+#define ISA			0
+#define EISA			1
+#define LOCAL_BUS		6
+#define PCI			7
+
+/* Memory types for GX, CX */
+#define DRAMx4			0
+#define VRAMx16			1
+#define VRAMx16ssr		2
+#define DRAMx16			3
+#define GraphicsDRAMx16		4
+#define EnhancedVRAMx16		5
+#define EnhancedVRAMx16ssr	6
+
+/* Memory types for CT, ET, VT, GT */
+#define DRAM			0
+#define EDO_DRAM		1
+#define PSEUDO_EDO		2
+#define SDRAM			3
+
+#define DAC_INTERNAL		0x00
+#define DAC_IBMRGB514		0x01
+#define DAC_ATI68875		0x02
+#define DAC_TVP3026_A		0x72
+#define DAC_BT476		0x03
+#define DAC_BT481		0x04
+#define DAC_ATT20C491		0x14
+#define DAC_SC15026		0x24
+#define DAC_MU9C1880		0x34
+#define DAC_IMSG174		0x44
+#define DAC_ATI68860_B		0x05
+#define DAC_ATI68860_C		0x15
+#define DAC_TVP3026_B		0x75
+#define DAC_STG1700		0x06
+#define DAC_ATT498		0x16
+#define DAC_STG1702		0x07
+#define DAC_SC15021		0x17
+#define DAC_ATT21C498		0x27
+#define DAC_STG1703		0x37
+#define DAC_CH8398		0x47
+#define DAC_ATT20C408		0x57
+
+#define CLK_ATI18818_0		0
+#define CLK_ATI18818_1		1
+#define CLK_STG1703		2
+#define CLK_CH8398		3
+#define CLK_INTERNAL		4
+#define CLK_ATT20C408		5
+#define CLK_IBMRGB514		6
+
+/* MEM_CNTL register constants */
+#define MEM_SIZE_ALIAS		0x00000007
+#define MEM_SIZE_512K		0x00000000
+#define MEM_SIZE_1M		0x00000001
+#define MEM_SIZE_2M		0x00000002
+#define MEM_SIZE_4M		0x00000003
+#define MEM_SIZE_6M		0x00000004
+#define MEM_SIZE_8M		0x00000005
+#define MEM_SIZE_ALIAS_GTB	0x0000000F
+#define MEM_SIZE_2M_GTB		0x00000003
+#define MEM_SIZE_4M_GTB		0x00000007
+#define MEM_SIZE_6M_GTB		0x00000009
+#define MEM_SIZE_8M_GTB		0x0000000B
+#define MEM_BNDRY		0x00030000
+#define MEM_BNDRY_0K		0x00000000
+#define MEM_BNDRY_256K		0x00010000
+#define MEM_BNDRY_512K		0x00020000
+#define MEM_BNDRY_1M		0x00030000
+#define MEM_BNDRY_EN		0x00040000
+
+/* ATI PCI constants */
+#define PCI_ATI_VENDOR_ID	0x1002
+#define PCI_MACH64_GX		0x4758
+#define PCI_MACH64_CX		0x4358
+#define PCI_MACH64_CT		0x4354
+#define PCI_MACH64_ET		0x4554
+#define PCI_MACH64_VT		0x5654
+#define PCI_MACH64_GT		0x4754
+
+/* CONFIG_CHIP_ID register constants */
+#define CFG_CHIP_TYPE		0x0000FFFF
+#define CFG_CHIP_CLASS		0x00FF0000
+#define CFG_CHIP_REV		0xFF000000
+#define CFG_CHIP_VERSION	0x07000000
+#define CFG_CHIP_FOUNDRY	0x38000000
+#define CFG_CHIP_REVISION	0xC0000000
+
+/* Chip IDs read from CONFIG_CHIP_ID */
+#define MACH64_GX_ID		0xD7
+#define MACH64_CX_ID		0x57
+#define MACH64_CT_ID		0x4354
+#define MACH64_ET_ID		0x4554
+#define MACH64_VT_ID		0x5654
+#define MACH64_GT_ID		0x4754
+
+/* Mach64 chip types */
+#define MACH64_UNKNOWN		0
+#define MACH64_GX		1
+#define MACH64_CX		2
+#define MACH64_CT		3
+#define MACH64_ET		4
+#define MACH64_VT		5
+#define MACH64_GT		6
+
+/* DST_CNTL register constants */
+#define DST_X_RIGHT_TO_LEFT	0
+#define DST_X_LEFT_TO_RIGHT	1
+#define DST_Y_BOTTOM_TO_TOP	0
+#define DST_Y_TOP_TO_BOTTOM	2
+#define DST_X_MAJOR		0
+#define DST_Y_MAJOR		4
+#define DST_X_TILE		8
+#define DST_Y_TILE		0x10
+#define DST_LAST_PEL		0x20
+#define DST_POLYGON_ENABLE	0x40
+#define DST_24_ROTATION_ENABLE	0x80
+
+/* SRC_CNTL register constants */
+#define SRC_PATTERN_ENABLE		1
+#define SRC_ROTATION_ENABLE		2
+#define SRC_LINEAR_ENABLE		4
+#define SRC_BYTE_ALIGN			8
+#define SRC_LINE_X_RIGHT_TO_LEFT	0
+#define SRC_LINE_X_LEFT_TO_RIGHT	0x10
+
+/* HOST_CNTL register constants */
+#define HOST_BYTE_ALIGN		1
+
+/* GUI_TRAJ_CNTL register constants */
+#define PAT_MONO_8x8_ENABLE	0x01000000
+#define PAT_CLR_4x2_ENABLE	0x02000000
+#define PAT_CLR_8x1_ENABLE	0x04000000
+
+/* DP_CHAIN_MASK register constants */
+#define DP_CHAIN_4BPP		0x8888
+#define DP_CHAIN_7BPP		0xD2D2
+#define DP_CHAIN_8BPP		0x8080
+#define DP_CHAIN_8BPP_RGB	0x9292
+#define DP_CHAIN_15BPP		0x4210
+#define DP_CHAIN_16BPP		0x8410
+#define DP_CHAIN_24BPP		0x8080
+#define DP_CHAIN_32BPP		0x8080
+
+/* DP_PIX_WIDTH register constants */
+#define DST_1BPP		0
+#define DST_4BPP		1
+#define DST_8BPP		2
+#define DST_15BPP		3
+#define DST_16BPP		4
+#define DST_32BPP		6
+#define SRC_1BPP		0
+#define SRC_4BPP		0x100
+#define SRC_8BPP		0x200
+#define SRC_15BPP		0x300
+#define SRC_16BPP		0x400
+#define SRC_32BPP		0x600
+#define HOST_1BPP		0
+#define HOST_4BPP		0x10000
+#define HOST_8BPP		0x20000
+#define HOST_15BPP		0x30000
+#define HOST_16BPP		0x40000
+#define HOST_32BPP		0x60000
+#define BYTE_ORDER_MSB_TO_LSB	0
+#define BYTE_ORDER_LSB_TO_MSB	0x1000000
+
+/* DP_MIX register constants */
+#define BKGD_MIX_NOT_D			0
+#define BKGD_MIX_ZERO			1
+#define BKGD_MIX_ONE			2
+#define BKGD_MIX_D			3
+#define BKGD_MIX_NOT_S			4
+#define BKGD_MIX_D_XOR_S		5
+#define BKGD_MIX_NOT_D_XOR_S		6
+#define BKGD_MIX_S			7
+#define BKGD_MIX_NOT_D_OR_NOT_S		8
+#define BKGD_MIX_D_OR_NOT_S		9
+#define BKGD_MIX_NOT_D_OR_S		10
+#define BKGD_MIX_D_OR_S			11
+#define BKGD_MIX_D_AND_S		12
+#define BKGD_MIX_NOT_D_AND_S		13
+#define BKGD_MIX_D_AND_NOT_S		14
+#define BKGD_MIX_NOT_D_AND_NOT_S	15
+#define BKGD_MIX_D_PLUS_S_DIV2		0x17
+#define FRGD_MIX_NOT_D			0
+#define FRGD_MIX_ZERO			0x10000
+#define FRGD_MIX_ONE			0x20000
+#define FRGD_MIX_D			0x30000
+#define FRGD_MIX_NOT_S			0x40000
+#define FRGD_MIX_D_XOR_S		0x50000
+#define FRGD_MIX_NOT_D_XOR_S		0x60000
+#define FRGD_MIX_S			0x70000
+#define FRGD_MIX_NOT_D_OR_NOT_S		0x80000
+#define FRGD_MIX_D_OR_NOT_S		0x90000
+#define FRGD_MIX_NOT_D_OR_S		0xa0000
+#define FRGD_MIX_D_OR_S			0xb0000
+#define FRGD_MIX_D_AND_S		0xc0000
+#define FRGD_MIX_NOT_D_AND_S		0xd0000
+#define FRGD_MIX_D_AND_NOT_S		0xe0000
+#define FRGD_MIX_NOT_D_AND_NOT_S	0xf0000
+#define FRGD_MIX_D_PLUS_S_DIV2		0x170000
+
+/* DP_SRC register constants */
+#define BKGD_SRC_BKGD_CLR	0
+#define BKGD_SRC_FRGD_CLR	1
+#define BKGD_SRC_HOST		2
+#define BKGD_SRC_BLIT		3
+#define BKGD_SRC_PATTERN	4
+#define FRGD_SRC_BKGD_CLR	0
+#define FRGD_SRC_FRGD_CLR	0x100
+#define FRGD_SRC_HOST		0x200
+#define FRGD_SRC_BLIT		0x300
+#define FRGD_SRC_PATTERN	0x400
+#define MONO_SRC_ONE		0
+#define MONO_SRC_PATTERN	0x10000
+#define MONO_SRC_HOST		0x20000
+#define MONO_SRC_BLIT		0x30000
+
+/* CLR_CMP_CNTL register constants */
+#define COMPARE_FALSE		0
+#define COMPARE_TRUE		1
+#define COMPARE_NOT_EQUAL	4
+#define COMPARE_EQUAL		5
+#define COMPARE_DESTINATION	0
+#define COMPARE_SOURCE		0x1000000
+
+/* FIFO_STAT register constants */
+#define FIFO_ERR		0x80000000
+
+/* CONTEXT_LOAD_CNTL constants */
+#define CONTEXT_NO_LOAD			0
+#define CONTEXT_LOAD			0x10000
+#define CONTEXT_LOAD_AND_DO_FILL	0x20000
+#define CONTEXT_LOAD_AND_DO_LINE	0x30000
+#define CONTEXT_EXECUTE			0
+#define CONTEXT_CMD_DISABLE		0x80000000
+
+/* GUI_STAT register constants */
+#define ENGINE_IDLE		0
+#define ENGINE_BUSY		1
+#define SCISSOR_LEFT_FLAG	0x10
+#define SCISSOR_RIGHT_FLAG	0x20
+#define SCISSOR_TOP_FLAG	0x40
+#define SCISSOR_BOTTOM_FLAG	0x80
+
+/* ATI VGA Extended Regsiters */
+#define sioATIEXT		0x1ce
+#define bioATIEXT		0x3ce
+
+#define ATI2E			0xae
+#define ATI32			0xb2
+#define ATI36			0xb6
+
+/* VGA Graphics Controller Registers */
+#define VGAGRA			0x3ce
+#define GRA06			0x06
+
+/* VGA Seququencer Registers */
+#define VGASEQ			0x3c4
+#define SEQ02			0x02
+#define SEQ04			0x04
+
+#define MACH64_MAX_X		ENGINE_MAX_X
+#define MACH64_MAX_Y		ENGINE_MAX_Y
+
+#define INC_X			0x0020
+#define INC_Y			0x0080
+
+#define RGB16_555		0x0000
+#define RGB16_565		0x0040
+#define RGB16_655		0x0080
+#define RGB16_664		0x00c0
+
+#define POLY_TEXT_TYPE		0x0001
+#define IMAGE_TEXT_TYPE		0x0002
+#define TEXT_TYPE_8_BIT		0x0004
+#define TEXT_TYPE_16_BIT	0x0008
+#define POLY_TEXT_TYPE_8	(POLY_TEXT_TYPE | TEXT_TYPE_8_BIT)
+#define IMAGE_TEXT_TYPE_8	(IMAGE_TEXT_TYPE | TEXT_TYPE_8_BIT)
+#define POLY_TEXT_TYPE_16	(POLY_TEXT_TYPE | TEXT_TYPE_16_BIT)
+#define IMAGE_TEXT_TYPE_16	(IMAGE_TEXT_TYPE | TEXT_TYPE_16_BIT)
+
+#define MACH64_NUM_CLOCKS	16
+#define MACH64_NUM_FREQS	50
+
+/* Wait until "v" queue entries are free */
+#define aty_WaitQueue(v)    { while ((aty_ld_le32(FIFO_STAT) & 0xffff) > \
+			 ((unsigned short)(0x8000 >> (v)))); }
+
+/* Wait until GP is idle and queue is empty */
+#define aty_WaitIdleEmpty() { aty_WaitQueue(16); \
+			  while ((aty_ld_le32(GUI_STAT) & 1) != 0); }
+
+#define SKIP_2(_v) ((((_v)<<1)&0xfff8)|((_v)&0x3)|(((_v)&0x80)>>5))
+
+#define MACH64_BIT_BLT(_srcx, _srcy, _dstx, _dsty, _w, _h, _dir) \
+{ \
+    aty_WaitQueue(5); \
+    aty_st_le32(SRC_Y_X, (((_srcx) << 16) | ((_srcy) & 0x0000ffff))); \
+    aty_st_le32(SRC_WIDTH1, (_w)); \
+    aty_st_le32(DST_CNTL, (_dir)); \
+    aty_st_le32(DST_Y_X, (((_dstx) << 16) | ((_dsty) & 0x0000ffff))); \
+    aty_st_le32(DST_HEIGHT_WIDTH, (((_w) << 16) | ((_h) & 0x0000ffff))); \
+}
+#endif /* REGMACH64_H */
+
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/atyfb.c m68k-2.1.72/drivers/video/atyfb.c
--- m68k-2.1.72-status/drivers/video/atyfb.c	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/atyfb.c	Wed Jan  7 22:03:28 1998
@@ -0,0 +1,1539 @@
+/*
+ *  linux/drivers/video/atyfb.c -- Frame buffer device for ATI/Open Firmware
+ *
+ *	Copyright (C) 1997 Geert Uytterhoeven
+ *
+ *  This driver is partly based on the PowerMac console driver:
+ *
+ *	Copyright (C) 1996 Paul Mackerras
+ *
+ *  and on the PowerMac ATI/mach64 display driver:
+ *
+ *	Copyright (C) 1997 Michael AK Tesch
+ *
+ *	      with work by Jon Howell
+ *			   Harry AC Eaton
+ *			   Anthony Tong <atong@uiuc.edu>
+ *
+ *  This file is subject to the terms and conditions of the GNU General Public
+ *  License. See the file COPYING in the main directory of this archive for
+ *  more details.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/tty.h>
+#include <linux/malloc.h>
+#include <linux/vmalloc.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/fb.h>
+#include <linux/selection.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/bios32.h>
+#include <linux/nvram.h>
+#include <linux/vc_ioctl.h>
+#include <asm/io.h>
+#include <asm/prom.h>
+#include <asm/pci-bridge.h>
+#include "aty.h"
+
+
+static int currcon = 0;
+static struct display fb_disp;
+static struct fb_info fb_info;
+static struct { u_char red, green, blue, pad; } palette[256];
+
+/* hack to tell fbcon-cfb{16,32} the colormap */
+extern u16 cfb16_cmap[16];
+extern u32 cfb32_cmap[16];
+
+static char atyfb_name[16] = "ATY Mach64";
+
+struct atyfb_par {
+    int video_mode;
+    int color_mode;
+};
+
+
+/*
+ * Video mode values.
+ * These are supposed to be the same as the values that
+ * Apple uses in MacOS.
+ */
+#define VMODE_NVRAM		0	/* use value stored in nvram */
+#define VMODE_512_384_60I	1	/* 512x384, 60Hz interlaced (NTSC) */
+#define VMODE_512_384_60	2	/* 512x384, 60Hz */
+#define VMODE_640_480_50I	3	/* 640x480, 50Hz interlaced (PAL) */
+#define VMODE_640_480_60I	4	/* 640x480, 60Hz interlaced (NTSC) */
+#define VMODE_640_480_60	5	/* 640x480, 60Hz (VGA) */
+#define VMODE_640_480_67	6	/* 640x480, 67Hz */
+#define VMODE_640_870_75P	7	/* 640x870, 75Hz (portrait) */
+#define VMODE_768_576_50I	8	/* 768x576, 50Hz (PAL full frame) */
+#define VMODE_800_600_56	9	/* 800x600, 56Hz */
+#define VMODE_800_600_60	10	/* 800x600, 60Hz */
+#define VMODE_800_600_72	11	/* 800x600, 72Hz */
+#define VMODE_800_600_75	12	/* 800x600, 75Hz */
+#define VMODE_832_624_75	13	/* 832x624, 75Hz */
+#define VMODE_1024_768_60	14	/* 1024x768, 60Hz */
+#define VMODE_1024_768_70	15	/* 1024x768, 70Hz (or 72Hz?) */
+#define VMODE_1024_768_75V	16	/* 1024x768, 75Hz (VESA) */
+#define VMODE_1024_768_75	17	/* 1024x768, 75Hz */
+#define VMODE_1152_870_75	18	/* 1152x870, 75Hz */
+#define VMODE_1280_960_75	19	/* 1280x960, 75Hz */
+#define VMODE_1280_1024_75	20	/* 1280x1024, 75Hz */
+#define VMODE_MAX		20
+#define VMODE_CHOOSE		99	/* choose based on monitor sense */
+
+/*
+ * Color mode values, used to select number of bits/pixel.
+ */
+#define CMODE_NVRAM		-1	/* use value stored in nvram */
+#define CMODE_8			0	/* 8 bits/pixel */
+#define CMODE_16		1	/* 16 (actually 15) bits/pixel */
+#define CMODE_32		2	/* 32 (actually 24) bits/pixel */
+
+
+static struct atyfb_par default_par = { VMODE_NVRAM, CMODE_NVRAM };
+static struct atyfb_par current_par;
+
+
+/*
+ * Addresses in NVRAM where video mode and pixel size are stored.
+ */
+#define NV_VMODE	0x140f
+#define NV_CMODE	0x1410
+
+/*
+ * Horizontal and vertical resolution information.
+ */
+extern struct vmode_attr {
+	int	hres;
+	int	vres;
+	int	vfreq;
+	int	interlaced;
+} vmode_attrs[VMODE_MAX];
+
+
+/*
+ * Horizontal and vertical resolution for each mode.
+ */
+static struct vmode_attr vmode_attrs[VMODE_MAX] = {
+    {512, 384, 60, 1},
+    {512, 384, 60},
+    {640, 480, 50, 1},
+    {640, 480, 60, 1},
+    {640, 480, 60},
+    {640, 480, 67},
+    {640, 870, 75},
+    {768, 576, 50, 1},
+    {800, 600, 56},
+    {800, 600, 60},
+    {800, 600, 72},
+    {800, 600, 75},
+    {832, 624, 75},
+    {1024, 768, 60},
+    {1024, 768, 72},
+    {1024, 768, 75},
+    {1024, 768, 75},
+    {1152, 870, 75},
+    {1280, 960, 75},
+    {1280, 1024, 75}
+};
+
+
+/*
+ * We get a sense value from the monitor and use it to choose
+ * what resolution to use.  This structure maps sense values
+ * to display mode values (which determine the resolution and
+ * frequencies).
+ */
+static struct mon_map {
+	int	sense;
+	int	vmode;
+} monitor_map [] = {
+	{0x000, VMODE_1280_1024_75},	/* 21" RGB */
+	{0x114, VMODE_640_870_75P},	/* Portrait Monochrome */
+	{0x221, VMODE_512_384_60},	/* 12" RGB*/
+	{0x331, VMODE_1280_1024_75},	/* 21" RGB (Radius) */
+	{0x334, VMODE_1280_1024_75},	/* 21" mono (Radius) */
+	{0x335, VMODE_1280_1024_75},	/* 21" mono */
+	{0x40A, VMODE_640_480_60I},	/* NTSC */
+	{0x51E, VMODE_640_870_75P},	/* Portrait RGB */
+	{0x603, VMODE_832_624_75},	/* 12"-16" multiscan */
+	{0x60b, VMODE_1024_768_70},	/* 13"-19" multiscan */
+	{0x623, VMODE_1152_870_75},	/* 13"-21" multiscan */
+	{0x62b, VMODE_640_480_67},	/* 13"/14" RGB */
+	{0x700, VMODE_640_480_50I},	/* PAL */
+	{0x714, VMODE_640_480_60I},	/* NTSC */
+	{0x717, VMODE_800_600_75},	/* VGA */
+	{0x72d, VMODE_832_624_75},	/* 16" RGB (Goldfish) */
+	{0x730, VMODE_768_576_50I},	/* PAL (Alternate) */
+	{0x73a, VMODE_1152_870_75},	/* 3rd party 19" */
+	{-1,	VMODE_640_480_60},	/* catch-all, must be last */
+};
+
+static int map_monitor_sense(int sense)
+{
+	struct mon_map *map;
+
+	for (map = monitor_map; map->sense >= 0; ++map)
+		if (map->sense == sense)
+			break;
+	return map->vmode;
+}
+
+struct aty_cmap_regs {
+    unsigned char windex;
+    unsigned char lut;
+    unsigned char mask;
+    unsigned char rindex;
+    unsigned char cntl;
+};
+
+typedef struct aty_regvals {
+    int offset[3];		/* first pixel address */
+
+    int crtc_h_sync_strt_wid[3];	/* depth dependant */
+    int crtc_gen_cntl[3];
+    int mem_cntl[3];
+
+    int crtc_h_tot_disp;	/* mode dependant */
+    int crtc_v_tot_disp;
+    int crtc_v_sync_strt_wid;
+    int crtc_off_pitch;
+
+    unsigned char clock_val[2];	/* vals for 20 and 21 */
+} aty_regvals;
+
+struct rage_regvals {
+    int h_total, h_sync_start, h_sync_width;
+    int v_total, v_sync_start, v_sync_width;
+    int h_sync_neg, v_sync_neg;
+};
+
+static int aty_vram_reqd(const struct atyfb_par *par);
+static struct aty_regvals *get_aty_struct(const struct atyfb_par *par);
+
+static unsigned char *frame_buffer;
+
+static int total_vram;		/* total amount of video memory, bytes */
+static int chip_type;		/* what chip type was detected */
+
+static unsigned long ati_regbase;
+static struct aty_cmap_regs *aty_cmap_regs;
+
+#include "ati-gx.h"
+#include "ati-gt.h"
+#include "ati-vt.h"
+
+static struct aty_regvals *aty_gt_reg_init[20] = {
+	NULL, NULL, NULL, NULL,
+	&aty_gt_reg_init_5,
+	&aty_gt_reg_init_6,
+	NULL, NULL,
+	&aty_gt_reg_init_9,
+	&aty_gt_reg_init_10,
+	&aty_gt_reg_init_11,
+	&aty_gt_reg_init_12,
+	&aty_gt_reg_init_13,
+	&aty_gt_reg_init_14,
+	&aty_gt_reg_init_15,
+	NULL,
+	&aty_gt_reg_init_17,
+	&aty_gt_reg_init_18,
+	NULL,
+	&aty_gt_reg_init_20
+};
+
+static struct aty_regvals *aty_gx_reg_init[20] = {
+	NULL, NULL, NULL, NULL,
+	&aty_gx_reg_init_6,
+	&aty_gx_reg_init_6,
+	NULL, NULL, NULL, NULL, NULL, NULL,
+	&aty_gx_reg_init_13,
+	&aty_gx_reg_init_14,
+	&aty_gx_reg_init_15,
+	NULL,
+	&aty_gx_reg_init_17,
+	NULL, NULL,
+	&aty_gx_reg_init_20
+};
+
+static struct aty_regvals *aty_vt_reg_init[21] = {
+	NULL, NULL, NULL, NULL,
+	&aty_vt_reg_init_5,
+	&aty_vt_reg_init_6,
+	NULL, NULL, NULL,
+	&aty_vt_reg_init_10,
+	&aty_vt_reg_init_11,
+	&aty_vt_reg_init_12,
+	&aty_vt_reg_init_13,
+	&aty_vt_reg_init_14,
+	&aty_vt_reg_init_15,
+	NULL,
+	&aty_vt_reg_init_17,
+	&aty_vt_reg_init_18,
+	&aty_vt_reg_init_19,
+	&aty_vt_reg_init_20
+};
+
+    /*
+     *  Interface used by the world
+     */
+
+unsigned long atyfb_init(unsigned long mem_start);
+void atyfb_setup(char *options, int *ints);
+
+static int atyfb_open(struct fb_info *info);
+static int atyfb_release(struct fb_info *info);
+static int atyfb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			 struct fb_info *info);
+static int atyfb_get_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info);
+static int atyfb_set_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info);
+static int atyfb_pan_display(struct fb_var_screeninfo *var, int con,
+			     struct fb_info *info);
+static int atyfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info);
+static int atyfb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info);
+static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
+		       u_long arg, int con, struct fb_info *info);
+
+#ifdef CONFIG_FB_COMPAT_XPMAC
+extern struct vc_mode display_info;
+extern int (*console_setmode_ptr)(struct vc_mode *, int);
+static int atyfb_console_setmode(struct vc_mode *, int);
+#endif
+
+
+    /*
+     *  Interface to the low level console driver
+     */
+
+static int atyfbcon_switch(int con, struct fb_info *info);
+static int atyfbcon_updatevar(int con, struct fb_info *info);
+static void atyfbcon_blank(int blank, struct fb_info *info);
+
+
+    /*
+     *  Internal routines
+     */
+
+static int atyfb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
+			 u_int *transp, struct fb_info *info);
+static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+			 u_int transp, struct fb_info *info);
+static void do_install_cmap(int con, struct fb_info *info);
+
+
+static struct fb_ops atyfb_ops = {
+    atyfb_open, atyfb_release, atyfb_get_fix, atyfb_get_var, atyfb_set_var,
+    atyfb_get_cmap, atyfb_set_cmap, atyfb_pan_display, atyfb_ioctl
+};
+
+
+static inline int aty_vram_reqd(const struct atyfb_par *par)
+{
+    return vmode_attrs[par->video_mode-1].vres *
+	(vmode_attrs[par->video_mode-1].hres << par->color_mode);
+}
+
+extern inline unsigned aty_ld_le32(volatile unsigned long addr)
+{
+    register unsigned long temp = ati_regbase,val;
+
+    asm("lwbrx %0,%1,%2": "=r"(val):"r"(addr), "r"(temp));
+    return val;
+}
+
+extern inline void aty_st_le32(volatile unsigned long addr, unsigned val)
+{
+    register unsigned long temp = ati_regbase;
+    asm("stwbrx %0,%1,%2": : "r"(val), "r"(addr), "r"(temp):"memory");
+}
+
+extern inline unsigned char aty_ld_8(volatile unsigned long addr)
+{
+    return *(char *) ((long) addr + (long) ati_regbase);
+}
+
+extern inline void aty_st_8(volatile unsigned long addr, unsigned char val)
+{
+    *(unsigned char *) (addr + (unsigned long) ati_regbase) = val;
+}
+
+static void aty_st_514(int offset, char val)
+{
+    aty_WaitQueue(5);
+    aty_st_8(DAC_CNTL, 1);
+    aty_st_8(DAC_W_INDEX, offset & 0xff);	/* right addr byte */
+    aty_st_8(DAC_DATA, (offset >> 8) & 0xff);	/* left addr byte */
+    eieio();
+    aty_st_8(DAC_MASK, val);
+    eieio();
+    aty_st_8(DAC_CNTL, 0);
+}
+
+static void aty_st_pll(int offset, char val)
+{
+    aty_WaitQueue(3);
+    aty_st_8(CLOCK_CNTL + 1, (offset << 2) | PLL_WR_EN);	/* write addr byte */
+    eieio();
+    aty_st_8(CLOCK_CNTL + 2, val);	/* write the register value */
+    eieio();
+    aty_st_8(CLOCK_CNTL + 1, (offset << 2) & ~PLL_WR_EN);
+}
+
+static struct aty_regvals *get_aty_struct(const struct atyfb_par *par)
+{
+    int v = par->video_mode - 1;
+
+    switch (chip_type) {
+	case MACH64_GT_ID:
+	    return aty_gt_reg_init[v];
+	    break;
+	case MACH64_VT_ID:
+	    return aty_vt_reg_init[v];
+	    break;
+	default: /* default to MACH64_GX_ID */
+	    return aty_gx_reg_init[v];
+	    break;
+    }
+}
+
+static int read_aty_sense(void)
+{
+    int sense, i;
+
+    aty_st_le32(GP_IO, 0x31003100);	/* drive outputs high */
+    __delay(200);
+    aty_st_le32(GP_IO, 0);		/* turn off outputs */
+    __delay(2000);
+    i = aty_ld_le32(GP_IO);		/* get primary sense value */
+    sense = ((i & 0x3000) >> 3) | (i & 0x100);
+
+    /* drive each sense line low in turn and collect the other 2 */
+    aty_st_le32(GP_IO, 0x20000000);	/* drive A low */
+    __delay(2000);
+    i = aty_ld_le32(GP_IO);
+    sense |= ((i & 0x1000) >> 7) | ((i & 0x100) >> 4);
+    aty_st_le32(GP_IO, 0x20002000);	/* drive A high again */
+    __delay(200);
+
+    aty_st_le32(GP_IO, 0x10000000);	/* drive B low */
+    __delay(2000);
+    i = aty_ld_le32(GP_IO);
+    sense |= ((i & 0x2000) >> 10) | ((i & 0x100) >> 6);
+    aty_st_le32(GP_IO, 0x10001000);	/* drive B high again */
+    __delay(200);
+
+    aty_st_le32(GP_IO, 0x01000000);	/* drive C low */
+    __delay(2000);
+    sense |= (aty_ld_le32(GP_IO) & 0x3000) >> 12;
+    aty_st_le32(GP_IO, 0);		/* turn off outputs */
+
+    return sense;
+}
+
+static void RGB514_Program(int cmode)
+{
+    typedef struct {
+	char pixel_dly;
+	char misc2_cntl;
+	char pixel_rep;
+	char pixel_cntl_index;
+	char pixel_cntl_v1;
+    } RGB514_DAC_Table;
+
+    static RGB514_DAC_Table RGB514DAC_Tab[8] = {
+	{0, 0x41, 0x03, 0x71, 0x45},	// 8bpp
+	{0, 0x45, 0x04, 0x0c, 0x01},	// 555
+	{0, 0x45, 0x06, 0x0e, 0x00},	// XRGB
+    };
+    RGB514_DAC_Table *pDacProgTab;
+
+    pDacProgTab = &RGB514DAC_Tab[cmode];
+
+    aty_st_514(0x90, 0x00);
+    aty_st_514(0x04, pDacProgTab->pixel_dly);
+    aty_st_514(0x05, 0x00);
+
+    aty_st_514(0x2, 0x1);
+    aty_st_514(0x71, pDacProgTab->misc2_cntl);
+    aty_st_514(0x0a, pDacProgTab->pixel_rep);
+
+    aty_st_514(pDacProgTab->pixel_cntl_index, pDacProgTab->pixel_cntl_v1);
+}
+
+/* handle video scrollback; offset is in # of scanlines */
+static void ati_set_origin(const struct atyfb_par *par, unsigned short lines)
+{
+	int x = (vmode_attrs[par->video_mode-1].hres + 7) & 0xfff8;
+	int reg;
+
+	reg = ((x >> 3) << 22) |	/* calculate pitch */
+	  ((lines * x * (1<<par->color_mode)) >> 3);
+
+	aty_st_le32(CRTC_OFF_PITCH, reg);
+	aty_st_le32(DST_OFF_PITCH, reg);
+	aty_st_le32(SRC_OFF_PITCH, reg);
+}
+
+static void atyfb_set_par(struct atyfb_par *par)
+{
+    int i, hres;
+    struct aty_regvals *init = get_aty_struct(par);
+    int vram_type = aty_ld_le32(CONFIG_STAT0) & 7;
+
+    if (init == 0)	/* paranoia, shouldn't get here */
+	panic("aty: display mode %d not supported", par->video_mode);
+
+    current_par = *par;
+    hres = vmode_attrs[par->video_mode-1].hres;
+
+    /* clear FIFO errors */
+    aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL) | BUS_HOST_ERR_ACK
+			  | BUS_FIFO_ERR_ACK);
+
+    /* Reset engine */
+    i = aty_ld_le32(GEN_TEST_CNTL);
+    aty_st_le32(GEN_TEST_CNTL, i & ~GUI_ENGINE_ENABLE);
+    eieio();
+    aty_WaitIdleEmpty();
+    aty_st_le32(GEN_TEST_CNTL, i | GUI_ENGINE_ENABLE);
+    aty_WaitIdleEmpty();
+
+    if ( chip_type != MACH64_GT_ID ) {
+	i = aty_ld_le32(CRTC_GEN_CNTL);
+	aty_st_le32(CRTC_GEN_CNTL, i | CRTC_EXT_DISP_EN);
+    }
+
+    if ( chip_type == MACH64_GX_ID ) {
+	i = aty_ld_le32(GEN_TEST_CNTL);
+	aty_st_le32(GEN_TEST_CNTL, i | GEN_OVR_OUTPUT_EN );
+    }
+
+    switch (chip_type) {
+	case MACH64_VT_ID:
+	    aty_st_pll(PLL_MACRO_CNTL, 0xb5);
+	    aty_st_pll(PLL_REF_DIV, 0x2d);
+	    aty_st_pll(PLL_GEN_CNTL, 0x14);
+	    aty_st_pll(MCLK_FB_DIV, 0xbd);
+	    aty_st_pll(PLL_VCLK_CNTL, 0x0b);
+	    aty_st_pll(VCLK_POST_DIV, init->clock_val[0]);
+	    aty_st_pll(VCLK0_FB_DIV, init->clock_val[1]);
+	    aty_st_pll(VCLK1_FB_DIV, 0xd6);
+	    aty_st_pll(VCLK2_FB_DIV, 0xee);
+	    aty_st_pll(VCLK3_FB_DIV, 0xf8);
+	    aty_st_pll(PLL_XCLK_CNTL, 0x0);
+	    aty_st_pll(PLL_TEST_CTRL, 0x0);
+	    aty_st_pll(PLL_TEST_COUNT, 0x0);
+	    break;
+	case MACH64_GT_ID:
+	    if (vram_type == 5) {
+		aty_st_pll(0, 0xcd);
+		aty_st_pll(PLL_MACRO_CNTL,
+			   par->video_mode >= VMODE_1024_768_60 ? 0xd3: 0xd5);
+		aty_st_pll(PLL_REF_DIV, 0x21);
+		aty_st_pll(PLL_GEN_CNTL, 0x44);
+		aty_st_pll(MCLK_FB_DIV, 0xe8);
+		aty_st_pll(PLL_VCLK_CNTL, 0x03);
+		aty_st_pll(VCLK_POST_DIV, init->offset[0]);
+		aty_st_pll(VCLK0_FB_DIV, init->offset[1]);
+		aty_st_pll(VCLK1_FB_DIV, 0x8e);
+		aty_st_pll(VCLK2_FB_DIV, 0x9e);
+		aty_st_pll(VCLK3_FB_DIV, 0xc6);
+		aty_st_pll(PLL_XCLK_CNTL, init->offset[2]);
+		aty_st_pll(12, 0xa6);
+		aty_st_pll(13, 0x1b);
+	    } else {
+		aty_st_pll(PLL_MACRO_CNTL, 0xd5);
+		aty_st_pll(PLL_REF_DIV, 0x21);
+		aty_st_pll(PLL_GEN_CNTL, 0xc4);
+		aty_st_pll(MCLK_FB_DIV, 0xda);
+		aty_st_pll(PLL_VCLK_CNTL, 0x03);
+		/* offset actually holds clock values */
+		aty_st_pll(VCLK_POST_DIV, init->offset[0]);
+		aty_st_pll(VCLK0_FB_DIV, init->offset[1]);
+		aty_st_pll(VCLK1_FB_DIV, 0x8e);
+		aty_st_pll(VCLK2_FB_DIV, 0x9e);
+		aty_st_pll(VCLK3_FB_DIV, 0xc6);
+		aty_st_pll(PLL_TEST_CTRL, 0x0);
+		aty_st_pll(PLL_XCLK_CNTL, init->offset[2]);
+		aty_st_pll(12, 0xa0);
+		aty_st_pll(13, 0x1b);
+	    }
+	    break;
+	default:
+	    RGB514_Program(par->color_mode);
+	    aty_WaitIdleEmpty();
+	    aty_st_514(0x06, 0x02);
+	    aty_st_514(0x10, 0x01);
+	    aty_st_514(0x70, 0x01);
+	    aty_st_514(0x8f, 0x1f);
+	    aty_st_514(0x03, 0x00);
+	    aty_st_514(0x05, 0x00);
+	    aty_st_514(0x20, init->clock_val[0]);
+	    aty_st_514(0x21, init->clock_val[1]);
+	    break;
+    }
+
+    aty_ld_8(DAC_REGS);	/* clear counter */
+    aty_WaitIdleEmpty();
+
+    aty_st_le32(CRTC_H_TOTAL_DISP, init->crtc_h_tot_disp);
+    aty_st_le32(CRTC_H_SYNC_STRT_WID, init->crtc_h_sync_strt_wid[par->color_mode]);
+    aty_st_le32(CRTC_V_TOTAL_DISP, init->crtc_v_tot_disp);
+    aty_st_le32(CRTC_V_SYNC_STRT_WID, init->crtc_v_sync_strt_wid);
+
+    aty_st_8(CLOCK_CNTL, 0);
+    aty_st_8(CLOCK_CNTL, CLOCK_STROBE);
+
+    aty_st_le32(CRTC_VLINE_CRNT_VLINE, 0);
+
+    if (chip_type == MACH64_GT_ID) {
+	aty_st_le32(BUS_CNTL, 0x7b23a040);
+
+	/* we calculate this so we can use a scrollback buffer.
+	 * this should theoretically work with other ati's
+	 * OFF_PITCH == (((hres + 7) & 0xfff8) >> 3) << 22
+	 */
+	ati_set_origin(par, 0);
+
+	/* need to set DSP values !! assume sdram */
+	i = init->crtc_gen_cntl[0] - (0x100000 * par->color_mode);
+	if ( vram_type == 5 )
+	    i = init->crtc_gen_cntl[1] - (0x100000 * par->color_mode);
+	aty_st_le32(DSP_CONFIG, i);
+
+	i = aty_ld_le32(MEM_CNTL) & MEM_SIZE_ALIAS;
+	if ( vram_type == 5 ) {
+	    i |= ((1 * par->color_mode) << 26) | 0x4215b0;
+	    aty_st_le32(DSP_ON_OFF,sgram_dsp[par->video_mode-1][par->color_mode]);
+
+	//aty_st_le32(CLOCK_CNTL,8192);
+	} else {
+	    i |= ((1 * par->color_mode) << 26) | 0x300090;
+	    aty_st_le32(DSP_ON_OFF, init->mem_cntl[par->color_mode]);
+	}
+
+	aty_st_le32(MEM_CNTL, i);
+	aty_st_le32(EXT_MEM_CNTL, 0x5000001);
+
+	/* if (total_vram > 0x400000)	
+	    i |= 0x538; this not been verified on > 4Megs!! */
+    } else {
+	aty_st_le32(CRTC_OFF_PITCH, init->crtc_off_pitch);
+
+/* The magic constant below translates into:
+* 5   = No RDY delay, 1 wait st for mem write, increment during burst transfer
+* 9   = DAC access delayed, 1 wait state for DAC
+* 0   = Disables interupts for FIFO errors
+* e   = Allows FIFO to generate 14 wait states before generating error
+* 1   = DAC snooping disabled, ROM disabled
+* 0   = ROM page at 0 (disabled so doesn't matter)
+* f   = 15 ROM wait states (disabled so doesn't matter)
+* f   = 15 BUS wait states (I'm not sure this applies to PCI bus types)
+* at some point it would be good to experiment with bench marks to see if
+* we can gain some speed by fooling with the wait states etc.
+*/
+	if (chip_type == MACH64_VT_ID)
+	    aty_st_le32(BUS_CNTL, 0x680000f9);
+	else
+	    aty_st_le32(BUS_CNTL, 0x590e10ff);
+
+	switch (total_vram) {
+	    case 0x00100000:
+		aty_st_le32(MEM_CNTL, vt_mem_cntl[0][par->color_mode]);
+		break;
+	    case 0x00200000:
+		aty_st_le32(MEM_CNTL, vt_mem_cntl[1][par->color_mode]);
+		break;
+	    case 0x00400000:
+		aty_st_le32(MEM_CNTL, vt_mem_cntl[2][par->color_mode]);
+		break;
+	    default:
+		i = aty_ld_le32(MEM_CNTL) & 0x000F;
+		aty_st_le32(MEM_CNTL,
+			    (init->mem_cntl[par->color_mode] & 0xFFFFFFF0) | i);
+	}
+    }
+/* These magic constants are harder to figure out
+* on the vt chipset bit 2 set makes the screen brighter
+* and bit 15 makes the screen black! But nothing else
+* seems to matter for the vt DAC_CNTL
+*/
+    switch (chip_type) {
+	case MACH64_GT_ID:
+	    i = 0x86010102;
+	    break;
+	case MACH64_VT_ID:
+	    i = 0x87010184;
+	    break;
+	default:
+	    i = 0x47012100;
+	    break;
+    }
+
+    aty_st_le32(DAC_CNTL, i);
+    aty_st_8(DAC_MASK, 0xff);
+
+    switch (par->color_mode) {
+	case CMODE_16:
+	    i = CRTC_PIX_WIDTH_15BPP; break;
+	/*case CMODE_24: */
+	case CMODE_32:
+	    i = CRTC_PIX_WIDTH_32BPP; break;
+	case CMODE_8:
+	default:
+	    i = CRTC_PIX_WIDTH_8BPP; break;
+    }
+
+    if (chip_type != MACH64_GT_ID) {
+	aty_st_le32(CRTC_INT_CNTL, 0x00000002);
+	aty_st_le32(GEN_TEST_CNTL, GUI_ENGINE_ENABLE | BLOCK_WRITE_ENABLE);	/* gui_en block_en */
+	i |= init->crtc_gen_cntl[par->color_mode];
+    }
+    /* Gentlemen, start your crtc engine */
+    aty_st_le32(CRTC_GEN_CNTL, CRTC_EXT_DISP_EN | CRTC_EXT_EN | i);
+
+#ifdef CONFIG_FB_COMPAT_XPMAC
+    display_info.height = vmode_attrs[par->video_mode-1].vres;
+    display_info.width = vmode_attrs[par->video_mode-1].hres;
+    display_info.depth = 8<<par->color_mode;
+    display_info.pitch = vmode_attrs[par->video_mode-1].hres<<par->color_mode;
+    display_info.mode = par->video_mode;
+    strcpy(display_info.name, atyfb_name);
+    display_info.fb_address = ((chip_type != MACH64_GT_ID) ?
+	(unsigned long) frame_buffer + init->offset[par->color_mode] :
+	(unsigned long) frame_buffer);
+    display_info.cmap_adr_address = (unsigned long) &aty_cmap_regs->windex;
+    display_info.cmap_data_address = (unsigned long) &aty_cmap_regs->lut;
+    display_info.disp_reg_address = ati_regbase;
+#endif /* CONFIG_FB_COMPAT_XPMAC) */
+}
+
+
+    /*
+     *  Open/Release the frame buffer device
+     */
+
+static int atyfb_open(struct fb_info *info)
+
+{
+    /*
+     *  Nothing, only a usage count for the moment
+     */
+
+    MOD_INC_USE_COUNT;
+    return(0);
+}
+
+static int atyfb_release(struct fb_info *info)
+{
+    MOD_DEC_USE_COUNT;
+    return(0);
+}
+
+
+static int encode_fix(struct fb_fix_screeninfo *fix,
+		       const struct atyfb_par *par)
+{
+    struct aty_regvals *init;
+
+    memset(fix, 0, sizeof(struct fb_fix_screeninfo));
+
+    strcpy(fix->id, atyfb_name);
+    init = get_aty_struct(par);
+    fix->smem_start = (char *)
+	((chip_type != MACH64_GT_ID) ?
+	    (unsigned long) frame_buffer + init->offset[par->color_mode] :
+	    (unsigned long) frame_buffer);
+    fix->smem_len = (unsigned long)total_vram-4096;	/* last page is MMIO */
+    fix->mmio_start = (char *)((unsigned long)ati_regbase & ~0xfff);
+    fix->mmio_len = 4096;
+    fix->type = FB_TYPE_PACKED_PIXELS;
+    fix->type_aux = 0;
+    fix->line_length = vmode_attrs[par->video_mode-1].hres<<par->color_mode;
+    fix->visual = par->color_mode == CMODE_8 ? FB_VISUAL_PSEUDOCOLOR
+					     : FB_VISUAL_TRUECOLOR;
+    fix->ywrapstep = 0;
+    fix->xpanstep = 0;
+    fix->ypanstep = 0;
+
+    return 0;
+}
+
+
+static int decode_var(struct fb_var_screeninfo *var,
+		      struct atyfb_par *par)
+{
+    int xres = var->xres;
+    int yres = var->yres;
+    int bpp = var->bits_per_pixel;
+    struct aty_regvals *init;
+
+    /* This should support more video modes */
+
+    /* No virtual screen yet */
+    if (var->xres_virtual > xres || var->yres_virtual > yres)
+	return -EINVAL;
+
+    if (xres <= 512 && yres <= 384)
+	par->video_mode = VMODE_512_384_60;	/* 512x384, 60Hz */
+    else if (xres <= 640 && yres <= 480)
+	par->video_mode = VMODE_640_480_67;	/* 640x480, 67Hz */
+    else if (xres <= 640 && yres <= 870)
+	par->video_mode = VMODE_640_870_75P;	/* 640x870, 75Hz (portrait) */
+    else if (xres <= 768 && yres <= 576)
+	par->video_mode = VMODE_768_576_50I;	/* 768x576, 50Hz (PAL full frame) */
+    else if (xres <= 800 && yres <= 600)
+	par->video_mode = VMODE_800_600_75;	/* 800x600, 75Hz */
+    else if (xres <= 832 && yres <= 624)
+	par->video_mode = VMODE_832_624_75;	/* 832x624, 75Hz */
+    else if (xres <= 1024 && yres <= 768)
+	par->video_mode = VMODE_1024_768_75;	/* 1024x768, 75Hz */
+    else if (xres <= 1152 && yres <= 870)
+	par->video_mode = VMODE_1152_870_75;	/* 1152x870, 75Hz */
+    else if (xres <= 1280 && yres <= 960)
+	par->video_mode = VMODE_1280_960_75;	/* 1280x960, 75Hz */
+    else if (xres <= 1280 && yres <= 1024)
+	par->video_mode = VMODE_1280_1024_75;	/* 1280x1024, 75Hz */
+    else
+	return -EINVAL;
+
+    if (bpp <= 8)
+	par->color_mode = CMODE_8;
+    else if (bpp <= 16)
+	par->color_mode = CMODE_16;
+    else if (bpp <= 32)
+	par->color_mode = CMODE_32;
+    else
+	return -EINVAL;
+
+    if (aty_vram_reqd(par) > total_vram)
+	return -EINVAL;
+
+    /* Check if we know about the wanted video mode */
+    init = get_aty_struct(par);
+    if (init == NULL || init->crtc_h_sync_strt_wid[par->color_mode] == 0 ||
+	(chip_type != MACH64_GT_ID &&
+	 init->crtc_gen_cntl[par->color_mode] == 0) ||
+	(chip_type == MACH64_GT_ID && (aty_ld_le32(CONFIG_STAT0) & 7) == 5 &&
+	 init->crtc_gen_cntl[1] == 0))
+	return -EINVAL;
+
+    return 0;
+}
+
+static int encode_var(struct fb_var_screeninfo *var,
+		      const struct atyfb_par *par)
+{
+    memset(var, 0, sizeof(struct fb_var_screeninfo));
+
+    var->xres = var->xres_virtual = vmode_attrs[par->video_mode-1].hres;
+    var->yres = var->yres_virtual = vmode_attrs[par->video_mode-1].vres;
+    var->xoffset = 0;
+    var->yoffset = 0;
+    var->grayscale = 0;
+    switch (par->color_mode) {
+	case CMODE_8:
+	    var->bits_per_pixel = 8;
+	    var->red.offset = 0;
+	    var->red.length = 8;
+	    var->green.offset = 0;
+	    var->green.length = 8;
+	    var->blue.offset = 0;
+	    var->blue.length = 8;
+	    var->transp.offset = 0;
+	    var->transp.length = 0;
+	    break;
+	case CMODE_16:	/* RGB 555 */
+	    var->bits_per_pixel = 16;
+	    var->red.offset = 10;
+	    var->red.length = 5;
+	    var->green.offset = 5;
+	    var->green.length = 5;
+	    var->blue.offset = 0;
+	    var->blue.length = 5;
+	    var->transp.offset = 0;
+	    var->transp.length = 0;
+	    break;
+	case CMODE_32:	/* RGB 888 */
+	    var->bits_per_pixel = 32;
+	    var->red.offset = 0;
+	    var->red.length = 8;
+	    var->green.offset = 8;
+	    var->green.length = 8;
+	    var->blue.offset = 16;
+	    var->blue.length = 8;
+	    var->transp.offset = 0;
+	    var->transp.length = 0;
+	    break;
+    }
+    var->red.msb_right = 0;
+    var->green.msb_right = 0;
+    var->blue.msb_right = 0;
+    var->transp.msb_right = 0;
+    var->nonstd = 0;
+    var->activate = 0;
+    var->height = -1;
+    var->width = -1;
+    var->accel = /* FB_ACCEL_ATY */ 0;
+    var->vmode = FB_VMODE_NONINTERLACED;
+    var->left_margin = var->right_margin = 64;	/* guesses */
+    var->upper_margin = var->lower_margin = 32;
+    var->hsync_len = 64;
+    var->vsync_len = 2;
+
+    /* no long long support in the kernel :-( */
+    /* this splittig trick will work if xres > 232 */
+    var->pixclock = 1000000000/
+	(var->left_margin+var->xres+var->right_margin+var->hsync_len);
+    var->pixclock *= 1000;
+    var->pixclock /= vmode_attrs[par->video_mode-1].vfreq*
+	 (var->upper_margin+var->yres+var->lower_margin+var->vsync_len);
+    var->sync = 0;
+
+    return 0;
+}
+
+
+    /*
+     *  Get the Fixed Part of the Display
+     */
+
+static int atyfb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			 struct fb_info *info)
+{
+    struct atyfb_par par;
+
+    if (con == -1)
+	par = default_par;
+    else
+	decode_var(&fb_display[con].var, &par);
+    encode_fix(fix, &par);
+    return 0;
+}
+
+
+    /*
+     *  Get the User Defined Part of the Display
+     */
+
+static int atyfb_get_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info)
+{
+    if (con == -1)
+	encode_var(var, &default_par);
+    else
+	*var=fb_display[con].var;
+    return 0;
+}
+
+
+    /*
+     *  Set the User Defined Part of the Display
+     */
+
+static int atyfb_set_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info)
+{
+    struct atyfb_par par;
+    struct display *display;
+    int oldxres, oldyres, oldvxres, oldvyres, oldbpp;
+    int err;
+    int activate = var->activate;
+
+    if (con >= 0)
+	display = &fb_display[con];
+    else
+	display = &fb_disp;	/* used during initialization */
+
+    if ((err = decode_var(var, &par)))
+	return err;
+
+    encode_var(var, &par);
+
+    if ((activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
+	oldxres = display->var.xres;
+	oldyres = display->var.yres;
+	oldvxres = display->var.xres_virtual;
+	oldvyres = display->var.yres_virtual;
+	oldbpp = display->var.bits_per_pixel;
+	display->var = *var;
+	if (oldxres != var->xres || oldyres != var->yres ||
+	    oldvxres != var->xres_virtual || oldvyres != var->yres_virtual ||
+	    oldbpp != var->bits_per_pixel) {
+	    struct fb_fix_screeninfo fix;
+
+	    encode_fix(&fix, &par);
+	    display->screen_base = (u_char *)fix.smem_start;
+	    display->visual = fix.visual;
+	    display->type = fix.type;
+	    display->type_aux = fix.type_aux;
+	    display->ypanstep = fix.ypanstep;
+	    display->ywrapstep = fix.ywrapstep;
+	    display->line_length = fix.line_length;
+	    display->can_soft_blank = 1;
+	    display->inverse = 0;
+	    if (fb_info.changevar)
+		(*fb_info.changevar)(con);
+	}
+	if (con == currcon)
+	    atyfb_set_par(&par);
+	if (oldbpp != var->bits_per_pixel) {
+	    if ((err = fb_alloc_cmap(&display->cmap, 0, 0)))
+		return err;
+	    do_install_cmap(con, info);
+	}
+    }
+
+    return 0;
+}
+
+
+    /*
+     *  Pan or Wrap the Display
+     *
+     *  This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
+     */
+
+static int atyfb_pan_display(struct fb_var_screeninfo *var, int con,
+			     struct fb_info *info)
+{
+    if (var->xoffset || var->yoffset)
+	return -EINVAL;
+    else
+	return 0;
+}
+
+    /*
+     *  Get the Colormap
+     */
+
+static int atyfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info)
+{
+    if (con == currcon) /* current console? */
+	return fb_get_cmap(cmap, &fb_display[con].var, kspc, atyfb_getcolreg,
+			   info);
+    else if (fb_display[con].cmap.len) /* non default colormap? */
+	fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
+    else
+	fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
+		     cmap, kspc ? 0 : 2);
+    return 0;
+}
+
+    /*
+     *  Set the Colormap
+     */
+
+static int atyfb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info)
+{
+    int err;
+
+    if (!fb_display[con].cmap.len) {	/* no colormap allocated? */
+	if ((err = fb_alloc_cmap(&fb_display[con].cmap,
+				 1<<fb_display[con].var.bits_per_pixel, 0)))
+	    return err;
+    }
+    if (con == currcon)			/* current console? */
+	return fb_set_cmap(cmap, &fb_display[con].var, kspc, atyfb_setcolreg,
+			   info);
+    else
+	fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
+    return 0;
+}
+
+
+static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
+		       u_long arg, int con, struct fb_info *info)
+{
+    return -EINVAL;
+}
+
+
+    /*
+     *  Initialisation
+     */
+
+__initfunc(unsigned long atyfb_init(unsigned long mem_start))
+{
+#ifdef __powerpc__
+    /* We don't want to be called like this. */
+    /* We rely on Open Firmware (offb) instead. */
+    return mem_start;
+#else /* !__powerpc__ */
+    /* To be merged with Bernd's mach64fb */
+    return mem_start;
+#endif /* !__powerpc__ */
+}
+
+
+unsigned long atyfb_of_init(unsigned long mem_start, struct device_node *dp)
+{
+    int i, err, sense;
+    struct fb_var_screeninfo var;
+    struct aty_regvals *init;
+    unsigned long addr;
+    unsigned char bus, devfn;
+    unsigned short cmd;
+
+    if (dp->next)
+	printk("Warning: only using first ATI card detected\n");
+    if (dp->n_addrs != 1 && dp->n_addrs != 3)
+	printk("Warning: expecting 1 or 3 addresses for ATY (got %d)",
+	       dp->n_addrs);
+
+    ati_regbase = (int)ioremap((0x7ffc00 + dp->addrs[0].address), 0x1000);
+    aty_cmap_regs = (struct aty_cmap_regs *)(ati_regbase + 0xC0);
+
+    /* enable memory-space accesses using config-space command register */
+    if (pci_device_loc(dp, &bus, &devfn) == 0) {
+	pcibios_read_config_word(bus, devfn, PCI_COMMAND, &cmd);
+	if (cmd != 0xffff) {
+	    cmd |= PCI_COMMAND_MEMORY;
+	    pcibios_write_config_word(bus, devfn, PCI_COMMAND, cmd);
+	}
+    }
+    chip_type = (aty_ld_le32(CONFIG_CHIP_ID) & CFG_CHIP_TYPE);
+
+    i = aty_ld_le32(MEM_CNTL);
+    if (chip_type != MACH64_GT_ID)
+	switch (i & MEM_SIZE_ALIAS) {
+	    case MEM_SIZE_512K:
+		total_vram = 0x80000;
+		break;
+	    case MEM_SIZE_1M:
+		total_vram = 0x100000;
+		break;
+	    case MEM_SIZE_2M:
+		total_vram = 0x200000;
+		break;
+	    case MEM_SIZE_4M:
+		total_vram = 0x400000;
+		break;
+	    case MEM_SIZE_6M:
+		total_vram = 0x600000;
+		break;
+	    case MEM_SIZE_8M:
+		total_vram = 0x800000;
+		break;
+	    default:
+		total_vram = 0x80000;
+	}
+    else
+	switch (i & 0xF) {	/* 0xF used instead of MEM_SIZE_ALIAS */
+	    case MEM_SIZE_512K:
+		total_vram = 0x80000;
+		break;
+	    case MEM_SIZE_1M:
+		total_vram = 0x100000;
+		break;
+	    case MEM_SIZE_2M_GTB:
+		total_vram = 0x200000;
+		break;
+	    case MEM_SIZE_4M_GTB:
+		total_vram = 0x400000;
+		break;
+	    case MEM_SIZE_6M_GTB:
+		total_vram = 0x600000;
+		break;
+	    case MEM_SIZE_8M_GTB:
+		total_vram = 0x800000;
+		break;
+	    default:
+		total_vram = 0x80000;
+	}
+
+#if 1
+    printk("aty_display_init: node = %p, addrs = ", dp->node);
+    printk(" %x(%x)", dp->addrs[0].address, dp->addrs[0].size);
+    printk(", intrs =");
+    for (i = 0; i < dp->n_intrs; ++i)
+    printk(" %x", dp->intrs[i]);
+    printk("\nregbase: %x pci loc: %x:%x total_vram: %x cregs: %p\n",
+	   (int)ati_regbase, bus, devfn, total_vram, aty_cmap_regs);
+#endif
+
+    /* Map in frame buffer */
+    addr = dp->addrs[0].address;
+
+    /* use the big-endian aperture (??) */
+    addr += 0x800000;
+    frame_buffer = ioremap(addr, 0x800000);
+
+    if (default_par.video_mode != -1) {
+	sense = read_aty_sense();
+	printk("monitor sense = %x\n", sense);
+	if (default_par.video_mode == VMODE_NVRAM) {
+	    default_par.video_mode = nvram_read_byte(NV_VMODE);
+	    init = get_aty_struct(&default_par);
+	    if (default_par.video_mode <= 0 ||
+		default_par.video_mode > VMODE_MAX || init == 0)
+		default_par.video_mode = VMODE_CHOOSE;
+	}
+	if (default_par.video_mode == VMODE_CHOOSE)
+	    default_par.video_mode = map_monitor_sense(sense);
+
+	init = get_aty_struct(&default_par);
+	if (!init)
+	    default_par.video_mode = VMODE_640_480_60;
+    }
+
+    /*
+     * Reduce the pixel size if we don't have enough VRAM.
+     */
+
+    if (default_par.color_mode == CMODE_NVRAM)
+	default_par.color_mode = nvram_read_byte(NV_CMODE);
+    if (default_par.color_mode < CMODE_8 ||
+	default_par.color_mode > CMODE_32)
+	default_par.color_mode = CMODE_8;
+
+    while (aty_vram_reqd(&default_par) > total_vram) {
+	while (default_par.color_mode > CMODE_8 &&
+	       aty_vram_reqd(&default_par) > total_vram)
+	    --default_par.color_mode;
+	/*
+	 * adjust the video mode smaller if there still is not enough VRAM
+	 */
+	if (aty_vram_reqd(&default_par) > total_vram)
+	    do {
+		default_par.video_mode--;
+		init = get_aty_struct(&default_par);
+	    } while ((init == 0) &&
+		     (default_par.video_mode > VMODE_640_480_60));
+    }
+
+    if (chip_type == MACH64_GT_ID && (aty_ld_le32(CONFIG_STAT0) & 7) == 5
+	&& init->crtc_gen_cntl[1] == 0) {
+	    default_par.video_mode = VMODE_640_480_67;
+	    default_par.color_mode = CMODE_8;
+    }
+
+    switch (chip_type) {
+	case MACH64_GX_ID:
+	    strcat(atyfb_name, "GX");
+	    break;
+	case MACH64_VT_ID:
+	    strcat(atyfb_name, "VT");
+	    break;
+	case MACH64_GT_ID:
+	    strcat(atyfb_name, "GT");
+	    break;
+	default:
+	    break;
+    }
+    strcpy(fb_info.modename, atyfb_name);
+    fb_info.node = -1;
+    fb_info.fbops = &atyfb_ops;
+    fb_info.disp = &fb_disp;
+    fb_info.fontname[0] = '\0';
+    fb_info.changevar = NULL;
+    fb_info.switch_con = &atyfbcon_switch;
+    fb_info.updatevar = &atyfbcon_updatevar;
+    fb_info.blank = &atyfbcon_blank;
+
+    err = register_framebuffer(&fb_info);
+    if (err < 0)
+	return mem_start;
+
+    for (i = 0; i < 16; i++) {
+	int j = color_table[i];
+	palette[i].red = default_red[j];
+	palette[i].green = default_grn[j];
+	palette[i].blue = default_blu[j];
+#ifdef CONFIG_FBCON_CFB16
+	cfb16_cmap[i] = ((i << 10) & 0x7c00) | ((i << 5) & 0x03e0) | (i & 0x1f);
+#endif
+#ifdef CONFIG_FBCON_CFB32
+	cfb32_cmap[i] = (i << 24) | (i << 16) | (i << 8) | i;
+#endif
+    }
+    atyfb_set_par(&default_par);
+    encode_var(&var, &default_par);
+    atyfb_set_var(&var, -1, &fb_info);
+
+    printk("%s frame buffer device on %s\n", atyfb_name, dp->full_name);
+
+#ifdef CONFIG_FB_COMPAT_XPMAC
+    console_setmode_ptr = atyfb_console_setmode;
+#endif /* CONFIG_FB_COMPAT_XPMAC) */
+
+    return mem_start;
+}
+
+
+/* XXX: doesn't work yet */
+void atyfb_setup(char *options, int *ints)
+{
+    char *this_opt;
+    int vmode;
+    int depth;
+
+    if (!options || !*options)
+	return;
+
+    for (this_opt = strtok(options, ","); this_opt;
+	 this_opt = strtok(NULL, ",")) {
+	if (!strncmp(this_opt, "vmode:", 6)) {
+	    vmode = simple_strtoul(this_opt+6, NULL, 0);
+	    if (vmode > 0 && vmode <= VMODE_MAX)
+		default_par.video_mode = vmode;
+	} else if (!strncmp(this_opt, "cmode:", 6)) {
+	    depth = simple_strtoul(this_opt+6, NULL, 0);
+	    switch (depth) {
+		case 8:
+		    default_par.color_mode = CMODE_8;
+		    break;
+		case 15:
+		case 16:
+		    default_par.color_mode = CMODE_16;
+		    break;
+		case 24:
+		case 32:
+		    default_par.color_mode = CMODE_32;
+		    break;
+	    };
+	}
+    }
+}
+
+
+static int atyfbcon_switch(int con, struct fb_info *info)
+{
+    struct atyfb_par par;
+
+    /* Do we have to save the colormap? */
+    if (fb_display[currcon].cmap.len)
+	fb_get_cmap(&fb_display[currcon].cmap, &fb_display[currcon].var, 1,
+		    atyfb_getcolreg, info);
+    currcon = con;
+    decode_var(&fb_display[con].var, &par);
+    atyfb_set_par(&par);
+    /* Install new colormap */
+    do_install_cmap(con, info);
+    return 0;
+}
+
+    /*
+     *  Update the `var' structure (called by fbcon.c)
+     */
+
+static int atyfbcon_updatevar(int con, struct fb_info *info)
+{
+    /* Nothing */
+    return 0;
+}
+
+    /*
+     *  Blank the display.
+     */
+
+static void atyfbcon_blank(int blank, struct fb_info *info)
+{
+    char gen_cntl;
+
+    gen_cntl = aty_ld_8(CRTC_GEN_CNTL);
+    if (blank & VESA_VSYNC_SUSPEND)
+	    gen_cntl |= 0x8;
+    if (blank & VESA_HSYNC_SUSPEND)
+	    gen_cntl |= 0x4;
+    if ((blank & VESA_POWERDOWN) == VESA_POWERDOWN)
+	    gen_cntl |= 0x40;
+    if (blank == VESA_NO_BLANKING)
+	    gen_cntl &= ~(0x4c);
+    aty_st_8(CRTC_GEN_CNTL, gen_cntl);
+}
+
+
+    /*
+     *  Read a single color register and split it into
+     *  colors/transparent. Return != 0 for invalid regno.
+     */
+
+static int atyfb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
+			 u_int *transp, struct fb_info *info)
+{
+    if (regno > 255)
+	return 1;
+    *red = palette[regno].red;
+    *green = palette[regno].green;
+    *blue = palette[regno].blue;
+    return 0;
+}
+
+
+    /*
+     *  Set a single color register. The values supplied are already
+     *  rounded down to the hardware's capabilities (according to the
+     *  entries in the var structure). Return != 0 for invalid regno.
+     */
+
+static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+			 u_int transp, struct fb_info *info)
+{
+    int i, scale;
+
+    if (regno > 255)
+	return 1;
+    palette[regno].red = red;
+    palette[regno].green = green;
+    palette[regno].blue = blue;
+    aty_WaitQueue(2);
+    i = aty_ld_8(DAC_CNTL) & 0xfc;
+    if (chip_type == MACH64_GT_ID)
+	    i |= 0x2;	/*DAC_CNTL|0x2 turns off the extra brightness for gt*/
+    aty_st_8(DAC_CNTL, i);
+    aty_st_8(DAC_REGS + DAC_MASK, 0xff);
+    eieio();
+    scale = ((chip_type != MACH64_GX_ID) &&
+	     (current_par.color_mode == CMODE_16)) ? 3 : 0;
+    aty_WaitQueue(4);
+    aty_cmap_regs->windex = regno << scale;
+    eieio();
+    aty_cmap_regs->lut = red << scale;
+    eieio();
+    aty_cmap_regs->lut = green << scale;
+    eieio();
+    aty_cmap_regs->lut = blue << scale;
+    eieio();
+    return 0;
+}
+
+
+static void do_install_cmap(int con, struct fb_info *info)
+{
+    if (con != currcon)
+	return;
+    if (fb_display[con].cmap.len)
+	fb_set_cmap(&fb_display[con].cmap, &fb_display[con].var, 1,
+		    atyfb_setcolreg, info);
+    else
+	fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
+				    &fb_display[con].var, 1, atyfb_setcolreg,
+		    info);
+}
+
+
+    /*
+     *  Accelerated functions
+     */
+
+void aty_waitblit(void)
+{
+    aty_WaitIdleEmpty();	/* Make sure that all commands have finished */
+}
+
+void aty_rectcopy(int srcx, int srcy, int dstx, int dsty, u_int width,
+		  u_int height)
+{
+    u_int direction = 0;
+
+    if (srcy < dsty) {
+	dsty += height - 1;
+	srcy += height - 1;
+    } else
+	direction |= DST_Y_TOP_TO_BOTTOM;
+
+    if (srcx < dstx) {
+	dstx += width - 1;
+	srcx += width - 1;
+    } else
+	direction |= DST_X_LEFT_TO_RIGHT;
+
+    aty_WaitQueue(4);
+    aty_st_le32(DP_WRITE_MSK, 0x000000FF /* pGC->planemask */ );
+    aty_st_le32(DP_MIX, (MIX_SRC << 16) |  MIX_DST);
+    aty_st_le32(DP_SRC, FRGD_SRC_BLIT);
+
+    aty_WaitQueue(5);
+    aty_st_le32(SRC_Y_X, (srcx << 16) | (srcy & 0x0000ffff));
+    aty_st_le32(SRC_WIDTH1, width);
+    aty_st_le32(DST_CNTL, direction);
+    aty_st_le32(DST_Y_X, (dstx << 16) | (dsty & 0x0000ffff));
+    aty_st_le32(DST_HEIGHT_WIDTH, (width << 16) | (height & 0x0000ffff));
+
+    aty_WaitIdleEmpty();	/* Make sure that all commands have finished */
+
+    /*
+     * Make sure that the destination trajectory is correctly set
+     * for subsequent calls.  MACH64_BIT_BLT is the only function that
+     * currently changes the destination trajectory from L->R and T->B.
+     */
+    aty_st_le32(DST_CNTL, (DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM));
+}
+
+void aty_rectfill(int dstx, int dsty, u_int width, u_int height, u_int color)
+{
+    if (!width || !height)
+	return;
+
+    aty_WaitQueue(5);
+    aty_st_le32(DP_FRGD_CLR, color              /* pGC->fgPixel */ );
+    aty_st_le32(DP_WRITE_MSK, 0x000000FF       /* pGC->planemask */ );
+    aty_st_le32(DP_MIX, (MIX_SRC << 16) | MIX_DST);
+    aty_st_le32(DP_SRC, FRGD_SRC_FRGD_CLR);
+
+    aty_st_le32(DST_CNTL, DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM);
+
+    aty_WaitQueue(2);
+    aty_st_le32(DST_Y_X, (((u_int)dstx << 16) | ((u_int)dsty & 0x0000ffff)));
+    aty_st_le32(DST_HEIGHT_WIDTH, (((u_int)width << 16) | height));
+
+    aty_WaitIdleEmpty();	/* Make sure that all commands have finished */
+}
+
+
+#ifdef CONFIG_FB_COMPAT_XPMAC
+
+    /*
+     *  Backward compatibility mode for Xpmac
+     */
+
+static int atyfb_console_setmode(struct vc_mode *mode, int doit)
+{
+    int err;
+    struct fb_var_screeninfo var;
+    struct atyfb_par par;
+
+    if (mode->mode <= 0 || mode->mode > VMODE_MAX )
+	return -EINVAL;
+    par.video_mode = mode->mode;
+
+    switch (mode->depth) {
+        case 24:
+        case 32:
+	    par.color_mode = CMODE_32;
+	    break;
+        case 16:
+	    par.color_mode = CMODE_16;
+	    break;
+        case 8:
+        case 0:			/* (default) */
+	    par.color_mode = CMODE_8;
+	    break;
+        default:
+	    return -EINVAL;
+    }
+    encode_var(&var, &par);
+    if ((err = decode_var(&var, &par)))
+	return err;
+    if (doit)
+	atyfb_set_var(&var, currcon, 0);
+    return 0;
+}
+
+#endif /* CONFIG_FB_COMPAT_XPMAC */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/cyberfb.c m68k-2.1.72/drivers/video/cyberfb.c
--- m68k-2.1.72-status/drivers/video/cyberfb.c	Wed Dec 17 23:55:14 1997
+++ m68k-2.1.72/drivers/video/cyberfb.c	Thu Jan  8 00:01:38 1998
@@ -20,7 +20,9 @@
  * for more details.
  */
 
+#define CYBERFBDEBUG
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -36,11 +38,55 @@
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/pgtable.h>
+#include <asm/amigahw.h>
 #include "s3blit.h"
 
+#ifdef CYBERFBDEBUG
+#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
+#else
+#define DPRINTK(fmt, args...)
+#endif
 
 #define arraysize(x)    (sizeof(x)/sizeof(*(x)))
 
+#if 1
+#define vgawb_3d(reg,dat) \
+                (*((unsigned char *)(CyberVGARegs + (reg ^ 3))) = dat)
+#define vgaww_3d(reg,dat) \
+                (*((unsigned word *)(CyberVGARegs + (reg ^ 2))) = swab16(dat))
+#define vgawl_3d(reg,dat) \
+                (*((unsigned long *)(CyberVGARegs + reg)) = swab32(dat))
+#else
+     /*
+      * Dunno why this doesn't work at the moment - we'll have to look at
+      * it later.
+      */
+#define vgawb_3d(reg,dat) \
+                (*((unsigned char *)(CyberRegs + 0x8000 + reg)) = dat)
+#define vgaww_3d(reg,dat) \
+                (*((unsigned word *)(CyberRegs + 0x8000 + reg)) = dat)
+#define vgawl_3d(reg,dat) \
+                (*((unsigned long *)(CyberRegs + 0x8000 + reg)) = dat)
+#endif
+
+     /*
+      * We asume P5 mapped the big-endian version of these registers.
+      */
+#define wb_3d(reg,dat) \
+                (*((unsigned char volatile *)(CyberRegs + reg)) = dat)
+#define ww_3d(reg,dat) \
+                (*((unsigned word volatile *)(CyberRegs + reg)) = dat)
+#define wl_3d(reg,dat) \
+                (*((unsigned long volatile *)(CyberRegs + reg)) = dat)
+
+#define rl_3d(reg) \
+                (*((unsigned long volatile *)(CyberRegs + reg)))
+
+
+#define wb_64(reg,dat) (*((unsigned char volatile *)CyberRegs + reg) = dat)
+
+
+
 struct cyberfb_par {
    int xres;
    int yres;
@@ -72,9 +118,9 @@
    int (*decode_var)(struct fb_var_screeninfo *var, struct cyberfb_par *par);
    int (*encode_var)(struct fb_var_screeninfo *var, struct cyberfb_par *par);
    int (*getcolreg)(u_int regno, u_int *red, u_int *green, u_int *blue,
-                    u_int *transp);
+                    u_int *transp, struct fb_info *info);
    int (*setcolreg)(u_int regno, u_int red, u_int green, u_int blue,
-                    u_int transp);
+                    u_int transp, struct fb_info *info);
    void (*blank)(int blank);
 } *fbhw;
 
@@ -106,7 +152,8 @@
 static unsigned long CyberMem;
 static unsigned long CyberSize;
 static volatile char *CyberRegs;
-
+static volatile unsigned long CyberVGARegs; /* ++Andre: for CV64/3D, see macros at the beginning */
+ 
 
 /*
  *    Predefined Video Modes
@@ -114,34 +161,55 @@
 
 static struct fb_videomode cyberfb_predefined[] __initdata = {
     {
-	"cyber8", {		/* Cybervision 8 bpp */
-	    CYBER8_WIDTH, CYBER8_HEIGHT, CYBER8_WIDTH, CYBER8_HEIGHT, 0, 0, 8, 0,
+	"640x480-8", {		/* Cybervision 8 bpp */
+	    640, 480, 640, 480, 0, 0, 8, 0,
 	    {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
 	    0, 0, -1, -1, FB_ACCEL_NONE, CYBER8_PIXCLOCK, 64, 96, 35, 12, 112, 2,
 	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
 	}
     }, {
-	"cyber16", {		/* Cybervision 16 bpp */
-	    800, 600, 800, 600, 0, 0, 16, 0,
-	    {11, 5, 0}, {5, 6, 0}, {0, 5, 0}, {0, 0, 0},
-	    0, 0, -1, -1, FB_ACCEL_NONE, CYBER16_PIXCLOCK, 64, 96, 35, 12, 112, 2,
+	"800x600-8", {		/* Cybervision 8 bpp */
+	    800, 600, 800, 600, 0, 0, 8, 0,
+	    {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
+	    0, 0, -1, -1, FB_ACCEL_NONE, CYBER8_PIXCLOCK, 64, 96, 35, 12, 112, 2,
 	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
 	}
     }, {
-	"800x600x8", {		/* Cybervision 8 bpp */
-	    800, 600, 800, 600, 0, 0, 8, 0,
+	"1024x768-8", {		/* Cybervision 8 bpp */
+	    1024, 768, 1024, 768, 0, 0, 8, 0,
 	    {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
 	    0, 0, -1, -1, FB_ACCEL_NONE, CYBER8_PIXCLOCK, 64, 96, 35, 12, 112, 2,
 	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
 	}
     }, {
-	"640x480x8", {		/* Cybervision 8 bpp */
-	    640, 480, 640, 480, 0, 0, 8, 0,
+	"1152x886-8", {		/* Cybervision 8 bpp */
+	    1152, 886, 1152, 886, 0, 0, 8, 0,
+	    {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
+	    0, 0, -1, -1, FB_ACCEL_NONE, CYBER8_PIXCLOCK, 64, 96, 35, 12, 112, 2,
+	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}
+    }, {
+	"1280x1024-8", {	/* Cybervision 8 bpp */
+	    1280, 1024, 1280, 1024, 0, 0, 8, 0,
+	    {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
+	    0, 0, -1, -1, FB_ACCEL_NONE, CYBER8_PIXCLOCK, 64, 96, 35, 12, 112, 2,
+	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}
+    }, {
+	"1600x1200-8", {	/* Cybervision 8 bpp */
+	    1600, 1200, 1600, 1200, 0, 0, 8, 0,
 	    {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
 	    0, 0, -1, -1, FB_ACCEL_NONE, CYBER8_PIXCLOCK, 64, 96, 35, 12, 112, 2,
 	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
 	}
-    },
+    }, {
+	"800x600-16", {		/* Cybervision 16 bpp */
+	    800, 600, 800, 600, 0, 0, 16, 0,
+	    {11, 5, 0}, {5, 6, 0}, {0, 5, 0}, {0, 0, 0},
+	    0, 0, -1, -1, FB_ACCEL_NONE, CYBER16_PIXCLOCK, 64, 96, 35, 12, 112, 2,
+	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}
+    }
 };
 
 
@@ -154,13 +222,14 @@
 static int Cyberfb_Cyber16 = 0;       /* Use Cybervision board */
 #endif
 
+static int CV3D = 0;
 
 /*
  *    Some default modes
  */
 
-#define CYBER8_DEFMODE     (1)
-#define CYBER16_DEFMODE    (2)
+#define CYBER8_DEFMODE     (0)
+#define CYBER16_DEFMODE    (6)
 
 static struct fb_var_screeninfo cyberfb_default;
 
@@ -171,19 +240,22 @@
 
 void cyberfb_setup(char *options, int *ints);
 
-static int cyberfb_open(int fbidx);
-static int cyberfb_release(int fbidx);
-static int cyberfb_get_fix(struct fb_fix_screeninfo *fix, int con, int fbidx);
-static int cyberfb_get_var(struct fb_var_screeninfo *var, int con, int fbidx);
-static int cyberfb_set_var(struct fb_var_screeninfo *var, int con, int fbidx);
+static int cyberfb_open(struct fb_info *info);
+static int cyberfb_release(struct fb_info *info);
+static int cyberfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct
+fb_info *info);
+static int cyberfb_get_var(struct fb_var_screeninfo *var, int con, struct
+fb_info *info);
+static int cyberfb_set_var(struct fb_var_screeninfo *var, int con, struct
+fb_info *info);
 static int cyberfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
-			     int fbidx);
+			    struct fb_info *info);
 static int cyberfb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
-			     int fbidx);
+			    struct fb_info *info);
 static int cyberfb_pan_display(struct fb_var_screeninfo *var, int con,
-				int fbidx);
+			       struct fb_info *info);
 static int cyberfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-                          u_long arg, int con, int fbidx);
+                         u_long arg, int con, struct fb_info *info);
 
 
 /*
@@ -191,9 +263,9 @@
  */
 
 unsigned long cyberfb_init(unsigned long mem_start);
-static int Cyberfb_switch(int con);
-static int Cyberfb_updatevar(int con);
-static void Cyberfb_blank(int blank);
+static int Cyberfb_switch(int con, struct fb_info *info);
+static int Cyberfb_updatevar(int con, struct fb_info *info);
+static void Cyberfb_blank(int blank, struct fb_info *info);
 
 
 /*
@@ -221,9 +293,9 @@
 static int Cyber_encode_var(struct fb_var_screeninfo *var,
                           struct cyberfb_par *par);
 static int Cyber_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
-                         u_int *transp);
+                         u_int *transp, struct fb_info *info);
 static int Cyber_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-                         u_int transp);
+                         u_int transp, struct fb_info *info);
 static void Cyber_blank(int blank);
 
 
@@ -231,11 +303,12 @@
  *    Internal routines
  */
 
+static int Cyber_probe(void);	/* looks whether a CV64 or a CV64/3D is plugged in */
 static void cyberfb_get_par(struct cyberfb_par *par);
 static void cyberfb_set_par(struct cyberfb_par *par);
 static int do_fb_set_var(struct fb_var_screeninfo *var, int isactive);
-static void do_install_cmap(int con);
-static void cyberfb_set_disp(int con);
+static void do_install_cmap(int con, struct fb_info *info);
+static void cyberfb_set_disp(int con, struct fb_info *info);
 static int get_video_mode(const char *name);
 
 
@@ -256,30 +329,60 @@
 	volatile u_long *CursorBase;
 
 	for (i = 0; i < 256; i++)
-
-		for (i = 0; i < 256; i++)
-		{
-			Cyber_colour_table [i][0] = i;
-			Cyber_colour_table [i][1] = i;
-			Cyber_colour_table [i][2] = i;
-			Cyber_colour_table [i][3] = 0;
-		}
+	{
+		Cyber_colour_table [i][0] = i;
+		Cyber_colour_table [i][1] = i;
+		Cyber_colour_table [i][2] = i;
+		Cyber_colour_table [i][3] = 0;
+	}
 
 	/*
 	 * Just clear the thing for the biggest mode.
+	 *
+	 * ++Andre, TODO: determine size first, then clear all memory
+	 *                (the 3D penguin might need texture memory :-) )
 	 */
 
-	memset ((char*)CyberMem, 0, CYBER8_WIDTH * CYBER8_HEIGHT);
+	memset ((char*)CyberMem, 0, 1600 * 1200);
 
 	/* Disable hardware cursor */
-	*(CyberRegs + S3_CRTC_ADR)  = S3_REG_LOCK2;
-	*(CyberRegs + S3_CRTC_DATA) = 0xa0;
-	*(CyberRegs + S3_CRTC_ADR)  = S3_HGC_MODE;
-	*(CyberRegs + S3_CRTC_DATA) = 0x00;
-	*(CyberRegs + S3_CRTC_ADR)  = S3_HWGC_DX;
-	*(CyberRegs + S3_CRTC_DATA) = 0x00;
-	*(CyberRegs + S3_CRTC_ADR)  = S3_HWGC_DY;
-	*(CyberRegs + S3_CRTC_DATA) = 0x00;
+	if (CV3D)
+	{
+		CyberSize = 0x00400000; /* 4 MB */
+
+		vgawb_3d(0x3c8, 255);
+		vgawb_3d(0x3c9, 56);
+		vgawb_3d(0x3c9, 100);
+		vgawb_3d(0x3c9, 160);
+
+		vgawb_3d(0x3c8, 254);
+		vgawb_3d(0x3c9, 0);
+		vgawb_3d(0x3c9, 0);
+		vgawb_3d(0x3c9, 0);
+
+		/* Disable hardware cursor */
+		vgawb_3d(S3_CRTC_ADR, S3_REG_LOCK2);
+		vgawb_3d(S3_CRTC_DATA, 0xa0);
+		vgawb_3d(S3_CRTC_ADR, S3_HGC_MODE);
+		vgawb_3d(S3_CRTC_DATA, 0x00);
+		vgawb_3d(S3_CRTC_ADR, S3_HWGC_DX);
+		vgawb_3d(S3_CRTC_DATA, 0x00);
+		vgawb_3d(S3_CRTC_ADR, S3_HWGC_DY);
+		vgawb_3d(S3_CRTC_DATA, 0x00);
+
+		return 0; /* TODO: hardware cursor for CV64/3D */
+	}
+	else
+	{
+		wb_64(S3_CRTC_ADR, S3_REG_LOCK2);
+		wb_64(S3_CRTC_DATA, 0xa0);
+		wb_64(S3_CRTC_ADR, S3_HGC_MODE);
+		wb_64(S3_CRTC_DATA, 0x00);
+		wb_64(S3_CRTC_ADR, S3_HWGC_DX);
+		wb_64(S3_CRTC_DATA, 0x00);
+		wb_64(S3_CRTC_ADR, S3_HWGC_DY);
+		wb_64(S3_CRTC_DATA, 0x00);
+	}
 
 	/* Get memory size (if not 2MB it is 4MB) */
 	*(CyberRegs + S3_CRTC_ADR) = S3_LAW_CTL;
@@ -306,8 +409,8 @@
 		*(CursorBase+3+(i*4)) = 0xffff0000;
 	}
 
-	Cyber_setcolreg (255, 56, 100, 160, 0);
-	Cyber_setcolreg (254, 0, 0, 0, 0);
+	Cyber_setcolreg (255, 56, 100, 160, 0, NULL /* unused */);
+	Cyber_setcolreg (254, 0, 0, 0, 0, NULL /* unused */);
 
 	return 0;
 }
@@ -327,7 +430,7 @@
 	fix->smem_start = (caddr_t)CyberMem;
 	fix->smem_len = CyberSize;
 	fix->mmio_start = (unsigned char *)CyberRegs;
-	fix->mmio_len = 0x10000;
+	fix->mmio_len = 0x10000; /* TODO: verify this for the CV64/3D */
 
 	fix->type = FB_TYPE_PACKED_PIXELS;
 	fix->type_aux = 0;
@@ -420,7 +523,18 @@
 
 	var->height = -1;
 	var->width = -1;
-	var->accel = FB_ACCEL_CYBERVISION;
+
+	if (CV3D)
+	{
+		var->accel = FB_ACCEL_CYBERVISION3D;
+		DPRINTK("accel CV64/3D\n");
+	}
+	else
+	{
+		var->accel = FB_ACCEL_CYBERVISION;
+		DPRINTK("accel CV64\n");
+	}
+
 	var->vmode = FB_VMODE_NONINTERLACED;
 
 	/* Dummy values */
@@ -451,20 +565,41 @@
  */
 
 static int Cyber_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-			   u_int transp)
+			   u_int transp, struct fb_info *info)
 {
 	if (regno > 255)
+	{
 		return (1);
+	}
+
+	/*
+	 * No colors on the CV3D yet.
+	 */
 
-	*(CyberRegs + 0x3c8) = (char)regno;
-	Cyber_colour_table [regno][0] = red & 0xff;
-	Cyber_colour_table [regno][1] = green & 0xff;
-	Cyber_colour_table [regno][2] = blue & 0xff;
-	Cyber_colour_table [regno][3] = transp;
-
-	*(CyberRegs + 0x3c9) = (red & 0xff) >> 2;
-	*(CyberRegs + 0x3c9) = (green & 0xff) >> 2;
-	*(CyberRegs + 0x3c9) = (blue & 0xff) >> 2;
+	if (CV3D)
+	{
+		vgawb_3d(0x3c8, (unsigned char) regno);
+		Cyber_colour_table [regno][0] = red & 0xff;
+		Cyber_colour_table [regno][1] = green & 0xff;
+		Cyber_colour_table [regno][2] = blue & 0xff;
+		Cyber_colour_table [regno][3] = transp;
+
+		vgawb_3d(0x3c9, ((red & 0xff) >> 2));
+		vgawb_3d(0x3c9, ((green & 0xff) >> 2));
+		vgawb_3d(0x3c9, ((blue & 0xff) >> 2));
+	}
+	else
+	{
+		wb_64(0x3c8, (unsigned char) regno);
+		Cyber_colour_table [regno][0] = red & 0xff;
+		Cyber_colour_table [regno][1] = green & 0xff;
+		Cyber_colour_table [regno][2] = blue & 0xff;
+		Cyber_colour_table [regno][3] = transp;
+
+		wb_64(0x3c9, (red & 0xff) >> 2);
+		wb_64(0x3c9, (green & 0xff) >> 2);
+		wb_64(0x3c9, (blue & 0xff) >> 2);
+	}
 
 	return (0);
 }
@@ -476,13 +611,13 @@
  */
 
 static int Cyber_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
-			   u_int *transp)
+			   u_int *transp, struct fb_info *info)
 {
 	if (regno >= 256)
 		return (1);
-	*red    = Cyber_colour_table [regno][0];
-	*green  = Cyber_colour_table [regno][1];
-	*blue   = Cyber_colour_table [regno][2];
+	*red	= Cyber_colour_table [regno][0];
+	*green	= Cyber_colour_table [regno][1];
+	*blue	= Cyber_colour_table [regno][2];
 	*transp = Cyber_colour_table [regno][3];
 	return (0);
 }
@@ -496,24 +631,156 @@
 {
 	int i;
 
-	if (blank)
-		for (i = 0; i < 256; i++)
+	if (CV3D)
+	{
+		if (blank)
+		{
+			for (i = 0; i < 256; i++)
+			{
+				vgawb_3d(0x3c8, (unsigned char) i);
+				vgawb_3d(0x3c9, 0);
+				vgawb_3d(0x3c9, 0);
+				vgawb_3d(0x3c9, 0);
+			}
+		}
+		else
 		{
-			*(CyberRegs + 0x3c8) = i;
-			*(CyberRegs + 0x3c9) = 0;
-			*(CyberRegs + 0x3c9) = 0;
-			*(CyberRegs + 0x3c9) = 0;
+			for (i = 0; i < 256; i++)
+			{
+				vgawb_3d(0x3c8, (unsigned char) i);
+				vgawb_3d(0x3c9, Cyber_colour_table[i][0] >> 2);
+				vgawb_3d(0x3c9, Cyber_colour_table[i][1] >> 2);
+				vgawb_3d(0x3c9, Cyber_colour_table[i][2] >> 2);
+			}
 		}
+	}
 	else
-		for (i = 0; i < 256; i++)
+	{
+		if (blank)
 		{
-			*(CyberRegs + 0x3c8) = i;
-			*(CyberRegs + 0x3c9) = Cyber_colour_table [i][0] >> 2;
-			*(CyberRegs + 0x3c9) = Cyber_colour_table [i][1] >> 2;
-			*(CyberRegs + 0x3c9) = Cyber_colour_table [i][2] >> 2;
+			for (i = 0; i < 256; i++)
+			{
+				wb_64(0x3c8, (unsigned char) i);
+				wb_64(0x3c9, 0);
+				wb_64(0x3c9, 0);
+				wb_64(0x3c9, 0);
+			}
 		}
+		else
+		{
+			for (i = 0; i < 256; i++)
+			{
+				wb_64(0x3c8, (unsigned char) i);
+				wb_64(0x3c9, Cyber_colour_table[i][0] >> 2);
+				wb_64(0x3c9, Cyber_colour_table[i][1] >> 2);
+				wb_64(0x3c9, Cyber_colour_table[i][2] >> 2);
+			}
+		}
+	}
 }
 
+#ifdef CONFIG_FB_CV3D
+
+/*
+ * CV3D low-level support
+ */
+
+#define Cyber3D_WaitQueue(v)	 { do { while ((rl_3d(0x8504) & 0x1f00) < (((v)+2) << 8)); } while (0); }
+
+static inline void Cyber3D_WaitBusy(void)
+{
+unsigned long status;
+
+	do {
+		status = rl_3d(0x8504);
+	} while (!(status & (1 << 13)));
+}
+
+#define S3V_BITBLT	(0x0 << 27)
+#define S3V_RECTFILL	(0x2 << 27)
+#define S3V_AUTOEXE	0x01
+#define S3V_HWCLIP	0x02
+#define S3V_DRAW	0x20
+#define S3V_DST_8BPP	0x00
+#define S3V_DST_16BPP	0x04
+#define S3V_DST_24BPP	0x08
+#define S3V_MONO_PAT	0x100
+
+#define S3V_BLT_COPY	(0xcc<<17)
+#define S3V_BLT_CLEAR	(0x00<<17)
+#define S3V_BLT_SET	(0xff<<17)
+
+ /*
+  * BitBLT - Through the Plane
+  */
+
+void Cyber3D_BitBLT (u_short curx, u_short cury, u_short destx, u_short desty,
+		     u_short width, u_short height)
+{
+	unsigned int blitcmd = S3V_BITBLT | S3V_DRAW | S3V_DST_8BPP;
+
+	blitcmd |= S3V_BLT_COPY;
+
+	/* Set drawing direction */
+	/* -Y, X maj, -X (default) */
+	if (curx > destx)
+	{
+		blitcmd |= (1 << 25);  /* Drawing direction +X */
+	}
+	else
+	{
+		curx  += (width - 1);
+		destx += (width - 1);
+	}
+
+	if (cury > desty)
+	{
+		blitcmd |= (1 << 26);  /* Drawing direction +Y */
+	}
+	else
+	{
+		cury  += (height - 1);
+		desty += (height - 1);
+	}
+
+	wl_3d(0xa4f4, 1); /* pattern fb color */
+
+	wl_3d(0xa4e8, ~0); /* mono pat 0 */
+	wl_3d(0xa4ec, ~0); /* mono pat 1 */
+
+	wl_3d(0xa504, ((width << 16) | height));	/* rwidth_height */
+	wl_3d(0xa508, ((curx << 16)  | cury));		/* rsrc_xy */
+	wl_3d(0xa50c, ((destx << 16) | desty));		/* rdest_xy */
+
+	wl_3d(0xa500, blitcmd);				/* GO! */
+
+	Cyber3D_WaitBusy();
+}
+
+/*
+ * Rectangle Fill Solid
+ */
+
+void Cyber3D_RectFill (u_short x, u_short y, u_short width, u_short height,
+		       u_short color)
+{
+	unsigned int tmp;
+	unsigned int blitcmd = S3V_RECTFILL | S3V_DRAW | S3V_DST_8BPP |
+		S3V_BLT_CLEAR | S3V_MONO_PAT | (1 << 26) | (1 << 25);
+
+	tmp = color & 0xff;
+	wl_3d(0xa4f4, tmp);
+
+	wl_3d(0xa504, ((width << 16) | height));	/* rwidth_height */
+	wl_3d(0xa50c, ((x << 16) | y));			/* rdest_xy */
+
+	wl_3d(0xa500, blitcmd);				/* GO! */
+	Cyber3D_WaitBusy();
+}
+
+#endif
+
+#ifdef CONFIG_FB_CYBER
 
 /**************************************************************
  * We are waiting for "fifo" FIFO-slots empty
@@ -547,7 +814,7 @@
  * BitBLT - Through the Plane
  */
 void Cyber_BitBLT (u_short curx, u_short cury, u_short destx, u_short desty,
-                   u_short width, u_short height, u_short mode)
+		   u_short width, u_short height, u_short mode)
 {
 	u_short blitcmd = S3_BITBLT;
 
@@ -590,10 +857,18 @@
  * Rectangle Fill Solid
  */
 void Cyber_RectFill (u_short x, u_short y, u_short width, u_short height,
-                     u_short mode, u_short color)
+		     u_short mode, u_short color)
 {
 	u_short blitcmd = S3_FILLEDRECT;
 
+#if 0
+	if (CV3D)
+	{
+		printk("Belly up .... RectFill on a 3D\n");
+		return;
+	}
+#endif
+
 	Cyber_WaitQueue (0x8000);
 
 	*((u_short volatile *)(CyberRegs + S3_PIXEL_CNTL)) = 0xa000;
@@ -610,13 +885,20 @@
 
 	*((u_short volatile *)(CyberRegs + S3_CMD)) = blitcmd;
 }
-
+#endif
 
 /**************************************************************
  * Move cursor to x, y
  */
 void Cyber_MoveCursor (u_short x, u_short y)
 {
+
+	if (CV3D)
+	{
+		printk("Yuck .... MoveCursor on a 3D\n");
+		return;
+	}
+
 	*(CyberRegs + S3_CRTC_ADR)  = 0x39;
 	*(CyberRegs + S3_CRTC_DATA) = 0xa0;
 
@@ -651,9 +933,13 @@
 static void cyberfb_get_par(struct cyberfb_par *par)
 {
 	if (current_par_valid)
+	{
 		*par = current_par;
+	}
 	else
+	{
 		fbhw->decode_var(&cyberfb_default, par);
+	}
 }
 
 
@@ -667,11 +953,24 @@
 static void cyber_set_video(struct fb_var_screeninfo *var)
 {
 	/* Set clipping rectangle to current screen size */
-	*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x1000;
-	*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x2000;
+ 
+	if (CV3D)
+	{
+		unsigned int clip;
 
-	*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x3000 | (var->yres - 1);
-	*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x4000 | (var->xres - 1);
+		clip = ((0 << 16) | (var->xres - 1));
+		wl_3d(0xa4dc, clip);
+		clip = ((0 << 16) | (var->yres - 1));
+		wl_3d(0xa4e0, clip);
+	}
+	else
+	{
+		*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x1000;
+		*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x2000;
+
+		*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x3000 | (var->yres - 1);
+		*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x4000 | (var->xres - 1);
+	}
 }
 
 
@@ -693,16 +992,16 @@
 }
 
 
-static void do_install_cmap(int con)
+static void do_install_cmap(int con, struct fb_info *info)
 {
 	if (con != currcon)
 		return;
 	if (fb_display[con].cmap.len)
 		fb_set_cmap(&fb_display[con].cmap, &fb_display[con].var, 1,
-			    fbhw->setcolreg);
+			    fbhw->setcolreg, info);
 	else
-		fb_set_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
-			    &fb_display[con].var, 1, fbhw->setcolreg);
+		fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
+			    &fb_display[con].var, 1, fbhw->setcolreg, info);
 }
 
 
@@ -710,7 +1009,7 @@
  *  Open/Release the frame buffer device
  */
 
-static int cyberfb_open(int fbidx)
+static int cyberfb_open(struct fb_info *info)
 {
 	/*
 	 * Nothing, only a usage count for the moment
@@ -720,7 +1019,7 @@
 	return(0);
 }
 
-static int cyberfb_release(int fbidx)
+static int cyberfb_release(struct fb_info *info)
 {
 	MOD_DEC_USE_COUNT;
 	return(0);
@@ -731,7 +1030,8 @@
  *    Get the Fixed Part of the Display
  */
 
-static int cyberfb_get_fix(struct fb_fix_screeninfo *fix, int con, int fbidx)
+static int cyberfb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			   struct fb_info *info)
 {
 	struct cyberfb_par par;
 	int error = 0;
@@ -748,21 +1048,28 @@
  *    Get the User Defined Part of the Display
  */
 
-static int cyberfb_get_var(struct fb_var_screeninfo *var, int con, int fbidx)
+static int cyberfb_get_var(struct fb_var_screeninfo *var, int con,
+			   struct fb_info *info)
 {
 	struct cyberfb_par par;
 	int error = 0;
 
-	if (con == -1) {
+	if (con == -1)
+	{
 		cyberfb_get_par(&par);
 		error = fbhw->encode_var(var, &par);
-	} else
+		disp.var = *var;   /* ++Andre: don't know if this is the right place */
+	}
+	else
+	{
 		*var = fb_display[con].var;
+	}
+
 	return(error);
 }
 
 
-static void cyberfb_set_disp(int con)
+static void cyberfb_set_disp(int con, struct fb_info *info)
 {
 	struct fb_fix_screeninfo fix;
 	struct display *display;
@@ -772,8 +1079,7 @@
 	else
 		display = &disp;	/* used during initialization */
 
-	/* ### FN: Needs fixes later */
-	cyberfb_get_fix(&fix, con, 0);
+	cyberfb_get_fix(&fix, con, info);
 	if (con == -1)
 		con = 0;
 	display->screen_base = (u_char *)fix.smem_start;
@@ -791,7 +1097,8 @@
  *    Set the User Defined Part of the Display
  */
 
-static int cyberfb_set_var(struct fb_var_screeninfo *var, int con, int fbidx)
+static int cyberfb_set_var(struct fb_var_screeninfo *var, int con,
+			   struct fb_info *info)
 {
 	int err, oldxres, oldyres, oldvxres, oldvyres, oldbpp;
 
@@ -808,10 +1115,10 @@
 		    oldvxres != var->xres_virtual ||
 		    oldvyres != var->yres_virtual ||
 		    oldbpp != var->bits_per_pixel) {
-			cyberfb_set_disp(con);
+			cyberfb_set_disp(con, info);
 			(*fb_info.changevar)(con);
 			fb_alloc_cmap(&fb_display[con].cmap, 0, 0);
-			do_install_cmap(con);
+			do_install_cmap(con, info);
 		}
 	}
 	var->activate = 0;
@@ -824,15 +1131,15 @@
  */
 
 static int cyberfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
-			     int fbidx)
+			    struct fb_info *info)
 {
 	if (con == currcon) /* current console? */
 		return(fb_get_cmap(cmap, &fb_display[con].var,
-				   kspc, fbhw->getcolreg));
+				   kspc, fbhw->getcolreg, info));
 	else if (fb_display[con].cmap.len) /* non default colormap? */
 		fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
 	else
-		fb_copy_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
+		fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
 			     cmap, kspc ? 0 : 2);
 	return(0);
 }
@@ -843,7 +1150,7 @@
  */
 
 static int cyberfb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
-			     int fbidx)
+			    struct fb_info *info)
 {
 	int err;
 
@@ -852,9 +1159,9 @@
 				 1<<fb_display[con].var.bits_per_pixel, 0)))
 			return(err);
 	}
-	if (con == currcon)              /* current console? */
+	if (con == currcon)		 /* current console? */
 		return(fb_set_cmap(cmap, &fb_display[con].var,
-				   kspc, fbhw->setcolreg));
+				   kspc, fbhw->setcolreg, info));
 	else
 		fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
 	return(0);
@@ -867,18 +1174,19 @@
  *    This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
  */
 
-static int cyberfb_pan_display(struct fb_var_screeninfo *var, int con, int fbidx)
+static int cyberfb_pan_display(struct fb_var_screeninfo *var, int con,
+			       struct fb_info *info)
 {
 	return(-EINVAL);
 }
 
 
 /*
-    *    Cybervision Frame Buffer Specific ioctls
+    *	 Cybervision Frame Buffer Specific ioctls
     */
 
 static int cyberfb_ioctl(struct inode *inode, struct file *file,
-                          u_int cmd, u_long arg, int con, int fbidx)
+			 u_int cmd, u_long arg, int con, struct fb_info *info)
 {
 	return(-EINVAL);
 }
@@ -891,6 +1199,21 @@
 };
 
 
+static int Cyber_probe(void)
+{
+#ifdef CONFIG_FB_CYBER
+	if ((CyberKey = zorro_find(ZORRO_PROD_PHASE5_CYBERVISION64, 0, 0)))
+		CV3D = 0;
+	else
+#endif
+#ifdef CONFIG_FB_CV3D
+	if ((CyberKey = zorro_find(ZORRO_PROD_PHASE5_CYBERVISION64_3D, 0, 0)))
+		CV3D = 1;
+#endif
+	return CyberKey;
+}
+
+
 __initfunc(void cyberfb_setup(char *options, int *ints))
 {
 	char *this_opt;
@@ -906,8 +1229,18 @@
 			fb_invert_cmaps();
 		} else if (!strncmp(this_opt, "font:", 5))
 			strcpy(fb_info.fontname, this_opt+5);
+		else if (!strcmp (this_opt, "cyber8")){
+			cyberfb_default = cyberfb_predefined[CYBER8_DEFMODE].var;
+		}
+		else if (!strcmp (this_opt, "cyber16")){
+			cyberfb_default = cyberfb_predefined[CYBER16_DEFMODE].var;
+		}
 		else
 			get_video_mode(this_opt);
+
+	DPRINTK("default mode: xres=%d, yres=%d, bpp=%d\n",cyberfb_default.xres,
+                                                           cyberfb_default.yres,
+		                                           cyberfb_default.bits_per_pixel);
 }
 
 
@@ -922,7 +1255,7 @@
 	unsigned long board_addr;
 	const struct ConfigDev *cd;
 
-	if (!(CyberKey = zorro_find(ZORRO_PROD_PHASE5_CYBERVISION64, 0, 0)))
+	if (!(CyberKey = Cyber_probe()))
 		return mem_start;
 
 	cd = zorro_get_board (CyberKey);
@@ -930,9 +1263,41 @@
 	board_addr = (unsigned long)cd->cd_BoardAddr;
 
 	/* This includes the video memory as well as the S3 register set */
-	CyberMem = kernel_map (board_addr + 0x01400000, 0x01000000,
-			       KERNELMAP_NOCACHE_SER, &mem_start);
-	CyberRegs = (char*) (CyberMem + 0x00c00000);
+        if (!CV3D)
+	{
+		CyberMem = kernel_map (board_addr + 0x01400000, 0x01000000,
+				       KERNELMAP_NOCACHE_SER, &mem_start);
+		CyberRegs = (char*) (CyberMem + 0x00c00000);
+	}
+	else
+	{
+        	if ((unsigned long)cd->cd_BoardAddr < 0x01000000)
+		{
+                        /*
+                         * Ok we got the board running in Z2 space.
+                         */
+ 
+			CyberMem = ZTWO_VADDR(board_addr);
+                        printk("CV3D detected running in Z2 mode ... not yet supported!\n");
+                        return -ENODEV;
+                }
+		else
+		{
+                        CyberVGARegs = kernel_map(board_addr +0x0c000000,
+                                                       0x00010000,
+                                                       KERNELMAP_NOCACHE_SER,
+                                                       &mem_start);
+                        CyberRegs = (char *)kernel_map(board_addr +0x05000000,
+                                                       0x00010000,
+                                                       KERNELMAP_NOCACHE_SER,
+                                                       &mem_start);
+                        CyberMem = kernel_map(board_addr + 0x04800000,
+                                              0x00400000,
+                                              KERNELMAP_NOCACHE_SER,
+                                              &mem_start);
+                        printk("CV3D detected running in Z3 mode\n");
+                }
+	}
 
 	fbhw = &Cyber_switch;
 
@@ -954,9 +1319,9 @@
 	fbhw->encode_var(&cyberfb_default, &par);
 
 	do_fb_set_var(&cyberfb_default, 1);
-	cyberfb_get_var(&fb_display[0].var, -1, GET_FB_IDX(fb_info.node));
-	cyberfb_set_disp(-1);
-	do_install_cmap(0);
+	cyberfb_get_var(&fb_display[0].var, -1, &fb_info);
+	cyberfb_set_disp(-1, &fb_info);
+	do_install_cmap(0, &fb_info);
 
 	printk("%s frame buffer device, using %ldK of video memory\n",
 	       fb_info.modename, CyberSize>>10);
@@ -968,17 +1333,17 @@
 }
 
 
-static int Cyberfb_switch(int con)
+static int Cyberfb_switch(int con, struct fb_info *info)
 {
 	/* Do we have to save the colormap? */
 	if (fb_display[currcon].cmap.len)
 		fb_get_cmap(&fb_display[currcon].cmap, &fb_display[currcon].var, 1,
-			    fbhw->getcolreg);
+			    fbhw->getcolreg, info);
 
 	do_fb_set_var(&fb_display[con].var, 1);
 	currcon = con;
 	/* Install new colormap */
-	do_install_cmap(con);
+	do_install_cmap(con, info);
 	return(0);
 }
 
@@ -990,7 +1355,7 @@
  *    Since it's called by a kernel driver, no range checking is done.
  */
 
-static int Cyberfb_updatevar(int con)
+static int Cyberfb_updatevar(int con, struct fb_info *info)
 {
 	return(0);
 }
@@ -1000,7 +1365,7 @@
     *    Blank the display.
     */
 
-static void Cyberfb_blank(int blank)
+static void Cyberfb_blank(int blank, struct fb_info *info)
 {
 	fbhw->blank(blank);
 }
@@ -1014,10 +1379,14 @@
 {
 	int i;
 
-	for (i = 0; i < NUM_TOTAL_MODES; i++)
-		if (!strcmp(name, cyberfb_predefined[i].name))
+	for (i = 0; i < NUM_TOTAL_MODES; i++) {
+		if (!strcmp(name, cyberfb_predefined[i].name)) {
 			cyberfb_default = cyberfb_predefined[i].var;
 			return(i);
+		}
+	}
+	/* ++Andre: set cyberfb default mode */
+	cyberfb_default = cyberfb_predefined[CYBER8_DEFMODE].var;
 	return(0);
 }
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/dnfb.c m68k-2.1.72/drivers/video/dnfb.c
--- m68k-2.1.72-status/drivers/video/dnfb.c	Wed Dec 17 23:56:07 1997
+++ m68k-2.1.72/drivers/video/dnfb.c	Wed Jan  7 23:27:26 1998
@@ -111,24 +111,29 @@
 
 /* frame buffer operations */
 
-static int dnfb_open(int fbidx);
-static int dnfb_release(int fbidx);
-static int dnfb_get_fix(struct fb_fix_screeninfo *fix, int con, int fbidx);
-static int dnfb_get_var(struct fb_var_screeninfo *var, int con, int fbidx);
-static int dnfb_set_var(struct fb_var_screeninfo *var, int con, int fbidx);
-static int dnfb_get_cmap(struct fb_cmap *cmap,int kspc,int con, int fbidx);
-static int dnfb_set_cmap(struct fb_cmap *cmap,int kspc,int con, int fbidx);
+static int dnfb_open(struct fb_info *info);
+static int dnfb_release(struct fb_info *info);
+static int dnfb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			struct fb_info *info);
+static int dnfb_get_var(struct fb_var_screeninfo *var, int con,
+			struct fb_info *info);
+static int dnfb_set_var(struct fb_var_screeninfo *var, int con,
+			struct fb_info *info);
+static int dnfb_get_cmap(struct fb_cmap *cmap,int kspc,int con,
+			 struct fb_info *info);
+static int dnfb_set_cmap(struct fb_cmap *cmap,int kspc,int con,
+			 struct fb_info *info);
 static int dnfb_pan_display(struct fb_var_screeninfo *var, int con,
-			     int fbidx);
+			    struct fb_info *info);
 static int dnfb_ioctl(struct inode *inode, struct file *file,
-		       unsigned int cmd, unsigned long arg, int con,
-		       int fbidx);
+		      unsigned int cmd, unsigned long arg, int con,
+		      struct fb_info *info);
 
-static int dnfbcon_switch(int con);
-static int dnfbcon_updatevar(int con);
-static void dnfbcon_blank(int blank);
+static int dnfbcon_switch(int con, struct fb_info *info);
+static int dnfbcon_updatevar(int con, struct fb_info *info);
+static void dnfbcon_blank(int blank, struct fb_info *info);
 
-static void dnfb_set_disp(int con);
+static void dnfb_set_disp(int con, struct fb_info *info);
 
 static struct display disp[MAX_NR_CONSOLES];
 static struct fb_info fb_info;
@@ -141,7 +146,7 @@
 
 static char dnfb_name[]="Apollo";
 
-static int dnfb_open(int fbidx)
+static int dnfb_open(struct fb_info *info)
 {
         /*
          * Nothing, only a usage count for the moment
@@ -151,13 +156,14 @@
         return(0);
 }
 
-static int dnfb_release(int fbidx)
+static int dnfb_release(struct fb_info *info)
 {
         MOD_DEC_USE_COUNT;
         return(0);
 }
 
-static int dnfb_get_fix(struct fb_fix_screeninfo *fix, int con, int fbidx)
+static int dnfb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			struct fb_info *info)
 {
 	memset(fix, 0, sizeof(struct fb_fix_screeninfo));
 	strcpy(fix->id,"Apollo Mono");
@@ -175,7 +181,8 @@
 
 }
         
-static int dnfb_get_var(struct fb_var_screeninfo *var, int con, int fbidx)
+static int dnfb_get_var(struct fb_var_screeninfo *var, int con,
+			struct fb_info *info)
 {
 	var->xres=1280;
 	var->yres=1024;
@@ -202,7 +209,8 @@
 
 }
 
-static int dnfb_set_var(struct fb_var_screeninfo *var, int con, int fbidx)
+static int dnfb_set_var(struct fb_var_screeninfo *var, int con,
+			struct fb_info *info)
 {
 	if(var->xres!=1280) 
 		return -EINVAL;
@@ -245,14 +253,16 @@
 
 }
 
-static int dnfb_get_cmap(struct fb_cmap *cmap, int kspc, int con, int fbidx)
+static int dnfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			 struct fb_info *info)
 {
 	printk("get cmap not supported\n");
 
 	return -EINVAL;
 }
 
-static int dnfb_set_cmap(struct fb_cmap *cmap, int kspc, int con, int fbidx)
+static int dnfb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			 struct fb_info *info)
 {
 	printk("set cmap not supported\n");
 
@@ -260,7 +270,8 @@
 
 }
 
-static int dnfb_pan_display(struct fb_var_screeninfo *var, int con, int fbidx)
+static int dnfb_pan_display(struct fb_var_screeninfo *var, int con,
+			    struct fb_info *info)
 {
 	printk("panning not supported\n");
 
@@ -269,17 +280,17 @@
 }
 
 static int dnfb_ioctl(struct inode *inode, struct file *file,
-		       unsigned int cmd, unsigned long arg, int con, int fbidx)
+		      unsigned int cmd, unsigned long arg, int con,
+		      struct fb_info *info)
 {
 	return -EINVAL;
 }
 
-static void dnfb_set_disp(int con)
+static void dnfb_set_disp(int con, struct fb_info *info)
 {
   struct fb_fix_screeninfo fix;
 
-  /* ### FN: Needs fixes later */
-  dnfb_get_fix(&fix, con, 0);
+  dnfb_get_fix(&fix, con, info);
   if(con==-1) 
     con=0;
 
@@ -325,16 +336,16 @@
         printk("apollo frame buffer alive and kicking !\n");
 
 	
-        dnfb_get_var(&disp[0].var, 0, GET_FB_IDX(fb_info.node));
+        dnfb_get_var(&disp[0].var, 0, &fb_info);
 
-	dnfb_set_disp(-1);
+	dnfb_set_disp(-1, &fb_info);
 
 	return mem_start;
 
 }	
 
 	
-static int dnfbcon_switch(int con)
+static int dnfbcon_switch(int con, struct fb_info *info)
 { 
 	currcon=con;
 	
@@ -342,12 +353,12 @@
 
 }
 
-static int dnfbcon_updatevar(int con)
+static int dnfbcon_updatevar(int con, struct fb_info *info)
 {
 	return 0;
 }
 
-static void dnfbcon_blank(int blank)
+static void dnfbcon_blank(int blank, struct fb_info *info)
 {
 	if(blank)  {
         	outb(0, AP_CONTROL_3A);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcmap.c m68k-2.1.72/drivers/video/fbcmap.c
--- m68k-2.1.72-status/drivers/video/fbcmap.c	Wed Dec 24 13:01:12 1997
+++ m68k-2.1.72/drivers/video/fbcmap.c	Wed Jan  7 22:03:28 1998
@@ -43,8 +43,8 @@
 };
 static u_short blue2[] = {
     0x0000, 0xaaaa
-};                                                  
- 
+};
+
 static u_short red4[] = {
     0x0000, 0xaaaa, 0x5555, 0xffff
 };
@@ -54,7 +54,7 @@
 static u_short blue4[] = {
     0x0000, 0xaaaa, 0x5555, 0xffff
 };
- 
+
 static u_short red8[] = {
     0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa
 };
@@ -64,7 +64,7 @@
 static u_short blue8[] = {
     0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa
 };
- 
+
 static u_short red16[] = {
     0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa,
     0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff
@@ -83,10 +83,10 @@
 };
 static struct fb_cmap default_8_colors = {
     0, 8, red8, green8, blue8, NULL
-};                                  
+};
 static struct fb_cmap default_4_colors = {
     0, 4, red4, green4, blue4, NULL
-};             
+};
 static struct fb_cmap default_16_colors = {
     0, 16, red16, green16, blue16, NULL
 };
@@ -99,40 +99,35 @@
 int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp)
 {
     int size = len*sizeof(u_short);
-    int bpp = 0;
-		    
+
     if (cmap->len != len) {
-	if (cmap->red)                                         
+	if (cmap->red)
 	    kfree(cmap->red);
 	if (cmap->green)
 	    kfree(cmap->green);
 	if (cmap->blue)
 	    kfree(cmap->blue);
 	if (cmap->transp)
-	    kfree(cmap->transp);            
-	cmap->red = cmap->green = cmap->blue = cmap->transp = NULL;    
-	cmap->len = 0;                          
-	if (!len) 
-	    return 0;                                      
+	    kfree(cmap->transp);
+	cmap->red = cmap->green = cmap->blue = cmap->transp = NULL;
+	cmap->len = 0;
+	if (!len)
+	    return 0;
 	if (!(cmap->red = kmalloc(size, GFP_ATOMIC)))
 	    return -1;
-	if (!(cmap->green = kmalloc(size, GFP_ATOMIC)))                 
+	if (!(cmap->green = kmalloc(size, GFP_ATOMIC)))
 	    return -1;
 	if (!(cmap->blue = kmalloc(size, GFP_ATOMIC)))
-	    return -1;                  
-	if (transp) {                            
+	    return -1;
+	if (transp) {
 	    if (!(cmap->transp = kmalloc(size, GFP_ATOMIC)))
-		return -1;                                      
-	} else                  
-	    cmap->transp = NULL;                                    
+		return -1;
+	} else
+	    cmap->transp = NULL;
     }
     cmap->start = 0;
     cmap->len = len;
-    while (len > 1) {
-	bpp++;
-	len >>= 1;
-    }
-    fb_copy_cmap(fb_default_cmap(bpp), cmap, 0);
+    fb_copy_cmap(fb_default_cmap(len), cmap, 0);
     return 0;
 }
 
@@ -155,12 +150,12 @@
 	size = from->len-fromoff;
     if (size < 0)
 	return;
-    size *= sizeof(u_short);                         
+    size *= sizeof(u_short);
     memcpy_fs(fsfromto, to->red+tooff, from->red+fromoff, size);
     memcpy_fs(fsfromto, to->green+tooff, from->green+fromoff, size);
     memcpy_fs(fsfromto, to->blue+tooff, from->blue+fromoff, size);
     if (from->transp && to->transp)
-	memcpy_fs(fsfromto, to->transp+tooff, from->transp+fromoff, size);                              
+	memcpy_fs(fsfromto, to->transp+tooff, from->transp+fromoff, size);
 }
 
 
@@ -169,7 +164,8 @@
      */
 
 int fb_get_cmap(struct fb_cmap *cmap, struct fb_var_screeninfo *var, int kspc,
-    	    	int (*getcolreg)(u_int, u_int *, u_int *, u_int *, u_int *))
+    	    	int (*getcolreg)(u_int, u_int *, u_int *, u_int *, u_int *,
+				 struct fb_info *), struct fb_info *info)
 {
     int i, start;
     u_short *red, *green, *blue, *transp;
@@ -183,7 +179,7 @@
     if (start < 0)
 	return -EINVAL;
     for (i = 0; i < cmap->len; i++) {
-	if (getcolreg(start++, &hred, &hgreen, &hblue, &htransp))
+	if (getcolreg(start++, &hred, &hgreen, &hblue, &htransp, info))
 	    return 0;
 	hred = CNVT_FROMHW(hred, var->red.length);
 	hgreen = CNVT_FROMHW(hgreen, var->green.length);
@@ -217,7 +213,8 @@
      */
 
 int fb_set_cmap(struct fb_cmap *cmap, struct fb_var_screeninfo *var, int kspc,
-    	    	int (*setcolreg)(u_int, u_int, u_int, u_int, u_int))
+    	    	int (*setcolreg)(u_int, u_int, u_int, u_int, u_int,
+				 struct fb_info *), struct fb_info *info)
 {
     int i, start;
     u_short *red, *green, *blue, *transp;
@@ -255,7 +252,7 @@
 	blue++;
 	if (transp)
 	    transp++;
-	if (setcolreg(start++, hred, hgreen, hblue, htransp))
+	if (setcolreg(start++, hred, hgreen, hblue, htransp, info))
 	    return 0;
     }
     return 0;
@@ -266,22 +263,15 @@
      *  Get the default colormap for a specific screen depth
      */
 
-struct fb_cmap *fb_default_cmap(int bpp)
+struct fb_cmap *fb_default_cmap(int len)
 {
-    switch (bpp) {                                                          
-	case 1:                                                       
-	    return &default_2_colors;
-	    break;
-	case 2:                                            
-	    return &default_4_colors;                             
-	    break;                                   
-	case 3:
-	    return &default_8_colors;                              
-	    break;
-	default:
-	    return &default_16_colors;
-	    break;                                                  
-    }
+    if (len <= 2)
+	return &default_2_colors;
+    if (len <= 4)
+	return &default_4_colors;
+    if (len <= 8)
+	return &default_8_colors;
+    return &default_16_colors;
 }
 
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon-afb.c m68k-2.1.72/drivers/video/fbcon-afb.c
--- m68k-2.1.72-status/drivers/video/fbcon-afb.c	Tue Nov 11 17:52:27 1997
+++ m68k-2.1.72/drivers/video/fbcon-afb.c	Wed Jan  7 22:03:28 1998
@@ -49,6 +49,8 @@
      *  Bitplanes ŕ la Amiga
      */
 
+static u_char expand_table[1024];
+
 static int open_afb(struct display *p)
 {
     if (p->type != FB_TYPE_PLANES)
@@ -60,6 +62,16 @@
 	p->next_line = p->var.xres_virtual>>3;
     p->next_plane = p->var.yres_virtual*p->next_line;
     MOD_INC_USE_COUNT;
+    if (!expand_table[1023]) {
+	/* initialise the table */
+	u_short i;
+	for (i = 0; i < 256; i++) {
+	    expand_table[i] = 0;	/* bg = fg = 0 */
+	    expand_table[i+256] = i;	/* bg = 0, fg = 1 */
+	    expand_table[i+512] = ~i;	/* bg = 1, fg = 0 */
+	    expand_table[i+768] = 0xff;	/* bg = fg = 1 */
+	}
+    }
     return 0;
 }
 
@@ -72,44 +84,49 @@
 	              int height, int width)
 {
     u_char *src, *dest, *src0, *dest0;
-    u_int i, rows;
+    u_short i, j;
 
     if (sx == 0 && dx == 0 && width == p->next_line) {
 	src = p->screen_base+sy*p->fontheight*width;
 	dest = p->screen_base+dy*p->fontheight*width;
-	for (i = p->var.bits_per_pixel; i--;) {
+	i = p->var.bits_per_pixel;
+	do {
 	    mymemmove(dest, src, height*p->fontheight*width);
 	    src += p->next_plane;
 	    dest += p->next_plane;
-	}
+	} while (--i);
     } else if (dy <= sy) {
 	src0 = p->screen_base+sy*p->fontheight*p->next_line+sx;
 	dest0 = p->screen_base+dy*p->fontheight*p->next_line+dx;
-	for (i = p->var.bits_per_pixel; i--;) {
+	i = p->var.bits_per_pixel;
+	do {
 	    src = src0;
 	    dest = dest0;
-	    for (rows = height*p->fontheight; rows--;) {
+	    j = height*p->fontheight;
+	    do {
 	        mymemmove(dest, src, width);
 	        src += p->next_line;
 	        dest += p->next_line;
-	    }
+	    } while (--j);
 	    src0 += p->next_plane;
 	    dest0 += p->next_plane;
-	}
+	} while (--i);
     } else {
 	src0 = p->screen_base+(sy+height)*p->fontheight*p->next_line+sx;
 	dest0 = p->screen_base+(dy+height)*p->fontheight*p->next_line+dx;
-	for (i = p->var.bits_per_pixel; i--;) {
+	i = p->var.bits_per_pixel;
+	do {
 	    src = src0;
 	    dest = dest0;
-	    for (rows = height*p->fontheight; rows--;) {
+	    j = height*p->fontheight;
+	    do {
 	        src -= p->next_line;
 	        dest -= p->next_line;
 	        mymemmove(dest, src, width);
-	    }
+	    } while (--j);
 	    src0 += p->next_plane;
 	    dest0 += p->next_plane;
-	}
+	} while (--i);
     }
 }
 
@@ -117,29 +134,33 @@
 	              int height, int width)
 {
     u_char *dest, *dest0;
-    u_int i, rows;
+    u_short i, j;
     int bg;
 
     dest0 = p->screen_base+sy*p->fontheight*p->next_line+sx;
 
     bg = attr_bgcol_ec(p,conp);
-    for (i = p->var.bits_per_pixel; i--; dest0 += p->next_plane) {
+    i = p->var.bits_per_pixel;
+    do {
 	dest = dest0;
-	for (rows = height*p->fontheight; rows--; dest += p->next_line)
+	j = height*p->fontheight;
+	do {
 	    if (bg & 1)
 	        mymemset(dest, width);
 	    else
 	        mymemclear(dest, width);
+	    dest += p->next_line;
+	} while (--j);
 	bg >>= 1;
-    }
+	dest0 += p->next_plane;
+    } while (--i);
 }
 
 static void putc_afb(struct vc_data *conp, struct display *p, int c, int yy,
 	             int xx)
 {
-    u_char *dest, *dest0, *cdat, *cdat0;
-    u_int rows, i;
-    u_char d;
+    u_char *dest, *dest0, *cdat, *cdat0, *expand;
+    u_short i, j;
     int fg, bg;
 
     c &= 0xff;
@@ -149,25 +170,24 @@
     fg = attr_fgcol(p,conp);
     bg = attr_bgcol(p,conp);
 
-    for (i = p->var.bits_per_pixel; i--; dest0 += p->next_plane) {
+    i = p->var.bits_per_pixel;
+    do {
 	dest = dest0;
 	cdat = cdat0;
-	for (rows = p->fontheight; rows--; dest += p->next_line) {
-	    d = *cdat++;
-	    if (bg & 1)
-	        if (fg & 1)
-	            *dest = 0xff;
-	        else
-	            *dest = ~d;
-	    else
-	        if (fg & 1)
-	            *dest = d;
-	        else
-	            *dest = 0x00;
-	}
+	expand = expand_table;
+	if (bg & 1)
+	    expand += 512;
+	if (fg & 1)
+	    expand += 256;
+	j = p->fontheight;
+	do {
+	    *dest = expand[*cdat++];
+	    dest += p->next_line;
+	} while (--j);
 	bg >>= 1;
 	fg >>= 1;
-    }
+	dest0 += p->next_plane;
+    } while (--i);
 }
 
     /*
@@ -178,11 +198,10 @@
 static void putcs_afb(struct vc_data *conp, struct display *p, const char *s,
 	              int count, int yy, int xx)
 {
-    u_char *dest, *dest0, *dest1;
+    u_char *dest, *dest0, *dest1, *expand;
     u_char *cdat1, *cdat2, *cdat3, *cdat4, *cdat10, *cdat20, *cdat30, *cdat40;
-    u_int rows, i;
+    u_short i, j;
     u_char c1, c2, c3, c4;
-    u_long d;
     int fg0, bg0, fg, bg;
 
     dest0 = p->screen_base+yy*p->fontheight*p->next_line+xx;
@@ -199,26 +218,25 @@
 	    fg = fg0;
 	    bg = bg0;
 
-	    for (i = p->var.bits_per_pixel; i--; dest1 += p->next_plane) {
+	    i = p->var.bits_per_pixel;
+	    do {
 	        dest = dest1;
 	        cdat1 = cdat10;
-	        for (rows = p->fontheight; rows--; dest += p->next_line) {
-	            d = *cdat1++;
-	            if (bg & 1)
-	                if (fg & 1)
-	                    *dest = 0xff;
-	                else
-	                    *dest = ~d;
-	            else
-	                if (fg & 1)
-	                    *dest = d;
-	                else
-	                    *dest = 0x00;
-	        }
+		expand = expand_table;
+		if (bg & 1)
+		    expand += 512;
+		if (fg & 1)
+		    expand += 256;
+		j = p->fontheight;
+		do {
+		    *dest = expand[*cdat1++];
+		    dest += p->next_line;
+	        } while (--j);
 	        bg >>= 1;
 	        fg >>= 1;
-	    }
-	} else {	/* Fast version */
+		dest1 += p->next_plane;
+	    } while (--i);
+	} else {			/* Fast version */
 	    c1 = s[0];
 	    c2 = s[1];
 	    c3 = s[2];
@@ -232,28 +250,39 @@
 	    fg = fg0;
 	    bg = bg0;
 
-	    for (i = p->var.bits_per_pixel; i--; dest1 += p->next_plane) {
+	    i = p->var.bits_per_pixel;
+	    do {
 	        dest = dest1;
 	        cdat1 = cdat10;
 	        cdat2 = cdat20;
 	        cdat3 = cdat30;
 	        cdat4 = cdat40;
-	        for (rows = p->fontheight; rows--; dest += p->next_line) {
-	            d = *cdat1++<<24 | *cdat2++<<16 | *cdat3++<<8 | *cdat4++;
-	            if (bg & 1)
-	                if (fg & 1)
-	                    *(u_long *)dest = 0xffffffff;
-	                else
-	                    *(u_long *)dest = ~d;
-	            else
-	                if (fg & 1)
-	                    *(u_long *)dest = d;
-	                else
-	                    *(u_long *)dest = 0x00000000;
-	        }
+		expand = expand_table;
+		if (bg & 1)
+		    expand += 512;
+		if (fg & 1)
+		    expand += 256;
+		j = p->fontheight;
+	        do {
+#if defined(__BIG_ENDIAN)
+		    *(u32 *)dest = expand[*cdat1++]<<24 |
+				   expand[*cdat2++]<<16 |
+				   expand[*cdat3++]<<8 |
+				   expand[*cdat4++];
+#elif defined(__LITTLE_ENDIAN)
+		    *(u32 *)dest = expand[*cdat1++] |
+				   expand[*cdat2++]<<8 |
+				   expand[*cdat3++]<<16 |
+				   expand[*cdat4++]<<24;
+#else
+#error FIXME: No endianness??
+#endif
+		    dest += p->next_line;
+	        } while (--j);
 	        bg >>= 1;
 	        fg >>= 1;
-	    }
+		dest1 += p->next_plane;
+	    } while (--i);
 	    s += 4;
 	    dest0 += 4;
 	    xx += 4;
@@ -264,7 +293,7 @@
 static void rev_char_afb(struct display *p, int xx, int yy)
 {
     u_char *dest, *dest0;
-    u_int rows, i;
+    u_short i, j;
     int mask;
 
     dest0 = p->screen_base+yy*p->fontheight*p->next_line+xx;
@@ -276,14 +305,19 @@
      *  inverting.
      */
 
-    for (i = p->var.bits_per_pixel; i--; dest0 += p->next_plane) {
+    i = p->var.bits_per_pixel;
+    do {
 	if (mask & 1) {
 	    dest = dest0;
-	    for (rows = p->fontheight; rows--; dest += p->next_line)
+	    j = p->fontheight;
+	    do {
 	        *dest = ~*dest;
+		dest += p->next_line;
+	    } while (--j);
 	}
 	mask >>= 1;
-    }
+	dest0 += p->next_plane;
+    } while (--i);
 }
 
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon-aty.c m68k-2.1.72/drivers/video/fbcon-aty.c
--- m68k-2.1.72-status/drivers/video/fbcon-aty.c	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/fbcon-aty.c	Wed Jan  7 22:03:28 1998
@@ -0,0 +1,213 @@
+/*
+ *  linux/drivers/video/fbcon-aty.c -- Low level frame buffer operations for 8
+ *				       bpp packed pixels on ATI (accelerated)
+ *
+ *	Copyright (C) 1997 Geert Uytterhoeven
+ *
+ *  This driver is based on fbcon-cfb8.c and on fbcon-mach64.c by Bernd Harries
+ *
+ *  This file is subject to the terms and conditions of the GNU General Public
+ *  License.  See the file COPYING in the main directory of this archive for
+ *  more details.
+ */
+
+#include <linux/module.h>
+#include <linux/tty.h>
+#include <linux/console.h>
+#include <linux/string.h>
+#include <linux/config.h>
+#include <linux/fb.h>
+
+#include "fbcon.h"
+
+
+    /*
+     *  Prototypes
+     */
+
+static int open_aty(struct display *p);
+static void release_aty(void);
+static void bmove_aty(struct display *p, int sy, int sx, int dy, int dx,
+		      int height, int width);
+static void clear_aty(struct vc_data *conp, struct display *p, int sy, int sx,
+		      int height, int width);
+static void putc_aty(struct vc_data *conp, struct display *p, int c, int yy,
+		      int xx);
+static void putcs_aty(struct vc_data *conp, struct display *p, const char *s,
+		      int count, int yy, int xx);
+static void rev_char_aty(struct display *p, int xx, int yy);
+
+
+    /*
+     *  Accelerated functions in atyfb.c
+     */
+
+extern void aty_waitblit(void);
+extern void aty_rectcopy(int srcx, int srcy, int dstx, int dsty, u_int width,
+			 u_int height);
+extern void aty_rectfill(int dstx, int dsty, u_int width, u_int height,
+			 u_int fcolor);
+
+
+    /*
+     *  `switch' for the low level operations
+     */
+
+static struct display_switch dispsw_aty = {
+    open_aty, release_aty, bmove_aty, clear_aty, putc_aty, putcs_aty,
+    rev_char_aty
+};
+
+
+    /*
+     *  8 bpp packed pixels
+     */
+
+static u32 nibbletab_aty[] = {
+#if defined(__BIG_ENDIAN)
+    0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff,
+    0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff, 
+    0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff, 
+    0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff
+#elif defined(__LITTLE_ENDIAN)
+    0x00000000, 0xff000000, 0x00ff0000, 0xffff0000, 
+    0x0000ff00, 0xff00ff00, 0x00ffff00, 0xffffff00, 
+    0x000000ff, 0xff0000ff, 0x00ff00ff, 0xffff00ff, 
+    0x0000ffff, 0xff00ffff, 0x00ffffff, 0xffffffff
+#else
+#error FIXME: No endianness??
+#endif
+};
+
+static int open_aty(struct display *p)
+{
+    printk("open_aty: probing...\n");
+    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 8 ||
+	(p->visual != FB_VISUAL_PSEUDOCOLOR &&
+	 p->visual != FB_VISUAL_STATIC_PSEUDOCOLOR) ||
+	p->var.accel != FB_ACCEL_ATY)
+	return -EINVAL;
+
+    printk("open_aty: using ATY acceleration\n");
+    p->next_line = p->var.xres_virtual;
+    p->next_plane = 0;
+    MOD_INC_USE_COUNT;
+    return 0;
+}
+
+static void release_aty(void)
+{
+    MOD_DEC_USE_COUNT;
+}
+
+static void bmove_aty(struct display *p, int sy, int sx, int dy, int dx,
+		      int height, int width)
+{
+    sx *= p->fontwidth;
+    sy *= p->fontheight;
+    dx *= p->fontwidth;
+    dy *= p->fontheight;
+    width *= p->fontwidth;
+    height *= p->fontheight;
+
+    aty_rectcopy(sx, sy, dx, dy, width, height);
+}
+
+static void clear_aty(struct vc_data *conp, struct display *p, int sy, int sx,
+		      int height, int width)
+{
+    u32 bgx = attr_bgcol_ec(p, conp);
+    bgx |= (bgx << 8);
+    bgx |= (bgx << 16);
+
+    sx *= p->fontwidth;
+    sy *= p->fontheight;
+    width *= p->fontwidth;
+    height *= p->fontheight;
+
+    aty_rectfill(sx, sy, width, height, bgx);
+}
+
+static void putc_aty(struct vc_data *conp, struct display *p, int c, int yy,
+		     int xx)
+{
+    u_char *dest, *cdat;
+    int bytes = p->next_line, rows;
+    u32 eorx, fgx, bgx;
+
+    c &= 0xff;
+
+    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
+    cdat = p->fontdata + c * p->fontheight;
+    fgx = attr_fgcol(p, conp);
+    bgx = attr_bgcol(p, conp);
+    fgx |= (fgx << 8);
+    fgx |= (fgx << 16);
+    bgx |= (bgx << 8);
+    bgx |= (bgx << 16);
+    eorx = fgx ^ bgx;
+
+    aty_waitblit();
+    for (rows = p->fontheight ; rows-- ; dest += bytes) {
+	((u32 *)dest)[0] = (nibbletab_aty[*cdat >> 4] & eorx) ^ bgx;
+	((u32 *)dest)[1] = (nibbletab_aty[*cdat++ & 0xf] & eorx) ^ bgx;
+    }
+}
+
+static void putcs_aty(struct vc_data *conp, struct display *p, const char *s,
+		      int count, int yy, int xx)
+{
+    u_char *cdat, c, *dest, *dest0;
+    int rows, bytes = p->next_line;
+    u32 eorx, fgx, bgx;
+
+    dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 8;
+    fgx = attr_fgcol(p, conp);
+    bgx = attr_bgcol(p, conp);
+    fgx |= (fgx << 8);
+    fgx |= (fgx << 16);
+    bgx |= (bgx << 8);
+    bgx |= (bgx << 16);
+    eorx = fgx ^ bgx;
+
+    aty_waitblit();
+    while (count--) {
+	c = *s++;
+	cdat = p->fontdata + c * p->fontheight;
+
+	for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
+	    ((u32 *)dest)[0] = (nibbletab_aty[*cdat >> 4] & eorx) ^ bgx;
+	    ((u32 *)dest)[1] = (nibbletab_aty[*cdat++ & 0xf] & eorx) ^ bgx;
+	}
+	dest0+=8;
+    }
+}
+
+static void rev_char_aty(struct display *p, int xx, int yy)
+{
+    u_char *dest;
+    int bytes = p->next_line, rows;
+
+    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
+    for (rows = p->fontheight ; rows-- ; dest += bytes) {
+	((u32 *)dest)[0] ^= 0x0f0f0f0f;
+	((u32 *)dest)[1] ^= 0x0f0f0f0f;
+    }
+}
+
+
+#ifdef MODULE
+int init_module(void)
+#else
+int fbcon_init_aty(void)
+#endif
+{
+    return(fbcon_register_driver(&dispsw_aty, 1));
+}
+
+#ifdef MODULE
+void cleanup_module(void)
+{
+    fbcon_unregister_driver(&dispsw_aty);
+}
+#endif /* MODULE */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon-cfb16.c m68k-2.1.72/drivers/video/fbcon-cfb16.c
--- m68k-2.1.72-status/drivers/video/fbcon-cfb16.c	Tue Nov 11 17:52:28 1997
+++ m68k-2.1.72/drivers/video/fbcon-cfb16.c	Wed Jan  7 22:03:28 1998
@@ -1,6 +1,6 @@
 /*
  *  linux/drivers/video/cfb16.c -- Low level frame buffer operations for 16 bpp
- *				   packed pixels
+ *				   truecolor packed pixels
  *
  *	Created 5 Apr 1997 by Geert Uytterhoeven
  *
@@ -50,15 +50,23 @@
      *  16 bpp packed pixels
      */
 
-u_short packed16_cmap[16];
+u16 cfb16_cmap[16];
 
-static u_long tab_cfb16[] = {
-    0x00000000,0x0000ffff,0xffff0000,0xffffffff
+static u32 tab_cfb16[] = {
+#if defined(__BIG_ENDIAN)
+    0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
+#elif defined(__LITTLE_ENDIAN)
+    0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff
+#else
+#error FIXME: No endianness??
+#endif
 };
 
 static int open_cfb16(struct display *p)
 {
-    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 16)
+    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 16 ||
+	(p->visual != FB_VISUAL_TRUECOLOR &&
+	 p->visual != FB_VISUAL_DIRECTCOLOR))
 	return -EINVAL;
 
     p->next_line = p->var.xres_virtual<<1;
@@ -76,7 +84,7 @@
 			int height, int width)
 {
     int bytes = p->next_line, linesize = bytes * p->fontheight, rows;
-    u_char *src,*dst;
+    u_char *src, *dst;
 
     if (sx == 0 && dx == 0 && width * 16 == bytes)
 	mymemmove(p->screen_base + dy * linesize,
@@ -104,34 +112,33 @@
 static void clear_cfb16(struct vc_data *conp, struct display *p, int sy,
 			int sx, int height, int width)
 {
-    u_char *dest0,*dest;
-    int bytes=p->next_line,lines=height * p->fontheight, rows, i;
-    u_long bgx;
+    u_char *dest0, *dest;
+    int bytes = p->next_line, lines = height * p->fontheight, rows, i;
+    u32 bgx;
 
     dest = p->screen_base + sy * p->fontheight * bytes + sx * 16;
 
-    bgx = attr_bgcol_ec(p,conp);
-    bgx = packed16_cmap[bgx];
+    bgx = cfb16_cmap[attr_bgcol_ec(p, conp)];
     bgx |= (bgx << 16);
 
     if (sx == 0 && width * 16 == bytes)
 	for (i = 0 ; i < lines * width ; i++) {
-	    ((u_long *)dest)[0]=bgx;
-	    ((u_long *)dest)[1]=bgx;
-	    ((u_long *)dest)[2]=bgx;
-	    ((u_long *)dest)[3]=bgx;
-	    dest+=16;
+	    ((u32 *)dest)[0] = bgx;
+	    ((u32 *)dest)[1] = bgx;
+	    ((u32 *)dest)[2] = bgx;
+	    ((u32 *)dest)[3] = bgx;
+	    dest += 16;
 	}
     else {
-	dest0=dest;
+	dest0 = dest;
 	for (rows = lines; rows-- ; dest0 += bytes) {
-	    dest=dest0;
+	    dest = dest0;
 	    for (i = 0 ; i < width ; i++) {
-		((u_long *)dest)[0]=bgx;
-		((u_long *)dest)[1]=bgx;
-		((u_long *)dest)[2]=bgx;
-		((u_long *)dest)[3]=bgx;
-		dest+=16;
+		((u32 *)dest)[0] = bgx;
+		((u32 *)dest)[1] = bgx;
+		((u32 *)dest)[2] = bgx;
+		((u32 *)dest)[3] = bgx;
+		dest += 16;
 	    }
 	}
     }
@@ -140,28 +147,27 @@
 static void putc_cfb16(struct vc_data *conp, struct display *p, int c, int yy,
 		       int xx)
 {
-    u_char *dest,*cdat;
-    int bytes=p->next_line,rows;
-    ulong eorx,fgx,bgx;
+    u_char *dest, *cdat;
+    int bytes = p->next_line, rows;
+    u32 eorx, fgx, bgx;
 
     c &= 0xff;
 
     dest = p->screen_base + yy * p->fontheight * bytes + xx * 16;
     cdat = p->fontdata + c * p->fontheight;
 
-    fgx = attr_fgcol(p,conp);
-    fgx = packed16_cmap[fgx];
-    bgx = attr_bgcol(p,conp);
-    bgx = packed16_cmap[bgx];
+    fgx = cfb16_cmap[attr_fgcol(p, conp)];
+    bgx = cfb16_cmap[attr_bgcol(p, conp)];
     fgx |= (fgx << 16);
     bgx |= (bgx << 16);
     eorx = fgx ^ bgx;
 
     for (rows = p->fontheight ; rows-- ; dest += bytes) {
-	((u_long *)dest)[0]= (tab_cfb16[*cdat >> 6] & eorx) ^ bgx;
-	((u_long *)dest)[1]= (tab_cfb16[*cdat >> 4 & 0x3] & eorx) ^ bgx;
-	((u_long *)dest)[2]= (tab_cfb16[*cdat >> 2 & 0x3] & eorx) ^ bgx;
-	((u_long *)dest)[3]= (tab_cfb16[*cdat++ & 0x3] & eorx) ^ bgx;
+	u_char bits = *cdat++;
+	((u32 *)dest)[0] = (tab_cfb16[bits >> 6] & eorx) ^ bgx;
+	((u32 *)dest)[1] = (tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx;
+	((u32 *)dest)[2] = (tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx;
+	((u32 *)dest)[3] = (tab_cfb16[bits & 3] & eorx) ^ bgx;
     }
 }
 
@@ -169,14 +175,12 @@
 			int count, int yy, int xx)
 {
     u_char *cdat, c, *dest, *dest0;
-    int rows,bytes=p->next_line;
-    u_long eorx, fgx, bgx;
+    int rows, bytes = p->next_line;
+    u32 eorx, fgx, bgx;
 
     dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 16;
-    fgx = attr_fgcol(p,conp);
-    fgx = packed16_cmap[fgx];
-    bgx = attr_bgcol(p,conp);
-    bgx = packed16_cmap[bgx];
+    fgx = cfb16_cmap[attr_fgcol(p, conp)];
+    bgx = cfb16_cmap[attr_bgcol(p, conp)];
     fgx |= (fgx << 16);
     bgx |= (bgx << 16);
     eorx = fgx ^ bgx;
@@ -185,26 +189,27 @@
 	cdat = p->fontdata + c * p->fontheight;
 
 	for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
-	    ((u_long *)dest)[0]= (tab_cfb16[*cdat >> 6] & eorx) ^ bgx;
-	    ((u_long *)dest)[1]= (tab_cfb16[*cdat >> 4 & 0x3] & eorx) ^ bgx;
-	    ((u_long *)dest)[2]= (tab_cfb16[*cdat >> 2 & 0x3] & eorx) ^ bgx;
-	    ((u_long *)dest)[3]= (tab_cfb16[*cdat++ & 0x3] & eorx) ^ bgx;
+	    u_char bits = *cdat++;
+	    ((u32 *)dest)[0] = (tab_cfb16[bits >> 6] & eorx) ^ bgx;
+	    ((u32 *)dest)[1] = (tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx;
+	    ((u32 *)dest)[2] = (tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx;
+	    ((u32 *)dest)[3] = (tab_cfb16[bits & 3] & eorx) ^ bgx;
 	}
-	dest0+=16;
+	dest0 += 16;
     }
 }
 
 static void rev_char_cfb16(struct display *p, int xx, int yy)
 {
     u_char *dest;
-    int bytes=p->next_line, rows;
+    int bytes = p->next_line, rows;
 
     dest = p->screen_base + yy * p->fontheight * bytes + xx * 16;
     for (rows = p->fontheight ; rows-- ; dest += bytes) {
-	((u_long *)dest)[0] ^= 0xffffffff;
-	((u_long *)dest)[1] ^= 0xffffffff;
-	((u_long *)dest)[2] ^= 0xffffffff;
-	((u_long *)dest)[3] ^= 0xffffffff;
+	((u32 *)dest)[0] ^= 0xffffffff;
+	((u32 *)dest)[1] ^= 0xffffffff;
+	((u32 *)dest)[2] ^= 0xffffffff;
+	((u32 *)dest)[3] ^= 0xffffffff;
     }
 }
 
@@ -230,4 +235,4 @@
      *  Visible symbols for modules
      */
 
-EXPORT_SYMBOL(packed16_cmap);
+EXPORT_SYMBOL(cfb16_cmap);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon-cfb2.c m68k-2.1.72/drivers/video/fbcon-cfb2.c
--- m68k-2.1.72-status/drivers/video/fbcon-cfb2.c	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/fbcon-cfb2.c	Wed Jan  7 22:03:28 1998
@@ -0,0 +1,328 @@
+/*
+ *  linux/drivers/video/cfb2.c -- Low level frame buffer operations for 8 bpp
+ *				  packed pixels
+ *
+ *	Created 26 Dec 1997 by Michael Schmitz
+ *	Based on 
+ *
+ *  This file is subject to the terms and conditions of the GNU General Public
+ *  License.  See the file COPYING in the main directory of this archive for
+ *  more details.
+ */
+
+#include <linux/module.h>
+#include <linux/tty.h>
+#include <linux/console.h>
+#include <linux/string.h>
+#include <linux/config.h>
+#include <linux/fb.h>
+
+#include "fbcon.h"
+
+
+    /*
+     *  Prototypes
+     */
+
+static int open_cfb2(struct display *p);
+static void release_cfb2(void);
+static void bmove_cfb2(struct display *p, int sy, int sx, int dy, int dx,
+		       int height, int width);
+static void clear_cfb2(struct vc_data *conp, struct display *p, int sy,
+		       int sx, int height, int width);
+static void putc_cfb2(struct vc_data *conp, struct display *p, int c, int yy,
+		      int xx);
+static void putcs_cfb2(struct vc_data *conp, struct display *p,
+		       const char *s, int count, int yy, int xx);
+static void rev_char_cfb2(struct display *p, int xx, int yy);
+
+
+    /*
+     *  `switch' for the low level operations
+     */
+
+static struct display_switch dispsw_cfb2 = {
+    open_cfb2, release_cfb2, bmove_cfb2, clear_cfb2, putc_cfb2, putcs_cfb2,
+    rev_char_cfb2
+};
+
+
+    /*
+     *  4 bpp packed pixels
+     */
+
+   /*
+    *		IFF the font is even pixel aligned (that is to say each
+    *		character start is a byte start in the pixel pairs). That
+    *		avoids us having to mask bytes and means we won't be here
+    *		all week. On a MacII that matters _lots_
+    */
+
+static u_short nibbletab_cfb2[]={
+0x0000,0x0003,0x000c,0x000f,
+0x0030,0x0033,0x003c,0x003f,
+0x00c0,0x00c3,0x00cc,0x00cf,
+0x00f0,0x00f3,0x00fc,0x00ff,
+
+0x0300,0x0303,0x030c,0x030f,
+0x0330,0x0333,0x033c,0x033f,
+0x03c0,0x03c3,0x03cc,0x03cf,
+0x03f0,0x03f3,0x03fc,0x03ff,
+
+0x0c00,0x0c03,0x0c0c,0x0c0f,
+0x0c30,0x0c33,0x0c3c,0x0c3f,
+0x0cc0,0x0cc3,0x0ccc,0x0ccf,
+0x0cf0,0x0cf3,0x0cfc,0x0cff,
+
+0x0f00,0x0f03,0x0f0c,0x000f,
+0x0f30,0x0f33,0x0f3c,0x003f,
+0x0fc0,0x0fc3,0x0fcc,0x00cf,
+0x0ff0,0x0ff3,0x0ffc,0x0fff,
+
+/* */
+0x3000,0x3003,0x300c,0x300f,
+0x3030,0x3033,0x303c,0x303f,
+0x30c0,0x30c3,0x30cc,0x30cf,
+0x30f0,0x30f3,0x30fc,0x30ff,
+
+0x3300,0x3303,0x330c,0x330f,
+0x3330,0x3333,0x333c,0x333f,
+0x33c0,0x33c3,0x33cc,0x33cf,
+0x33f0,0x33f3,0x33fc,0x33ff,
+
+0x3c00,0x3c03,0x3c0c,0x3c0f,
+0x3c30,0x3c33,0x3c3c,0x3c3f,
+0x3cc0,0x3cc3,0x3ccc,0x3ccf,
+0x3cf0,0x3cf3,0x3cfc,0x3cff,
+
+0x3f00,0x3f03,0x3f0c,0x3f0f,
+0x3f30,0x3f33,0x3f3c,0x3f3f,
+0x3fc0,0x3fc3,0x3fcc,0x3fcf,
+0x3ff0,0x3ff3,0x3ffc,0x3fff,
+
+/* */
+0xc000,0xc003,0xc00c,0xc00f,
+0xc030,0xc033,0xc03c,0xc03f,
+0xc0c0,0xc0c3,0xc0cc,0xc0cf,
+0xc0f0,0xc0f3,0xc0fc,0xc0ff,
+
+0xc300,0xc303,0xc30c,0xc30f,
+0xc330,0xc333,0xc33c,0xc33f,
+0xc3c0,0xc3c3,0xc3cc,0xc3cf,
+0xc3f0,0xc3f3,0xc3fc,0xc3ff,
+
+0xcc00,0xcc03,0xcc0c,0xcc0f,
+0xcc30,0xcc33,0xcc3c,0xcc3f,
+0xccc0,0xccc3,0xcccc,0xcccf,
+0xccf0,0xccf3,0xccfc,0xccff,
+
+0xcf00,0xcf03,0xcf0c,0xcf0f,
+0xcf30,0xcf33,0xcf3c,0xcf3f,
+0xcfc0,0xcfc3,0xcfcc,0xcfcf,
+0xcff0,0xcff3,0xcffc,0xcfff,
+
+/* */
+0xf000,0xf003,0xf00c,0xf00f,
+0xf030,0xf033,0xf03c,0xf03f,
+0xf0c0,0xf0c3,0xf0cc,0xf0cf,
+0xf0f0,0xf0f3,0xf0fc,0xf0ff,
+
+0xf300,0xf303,0xf30c,0xf30f,
+0xf330,0xf333,0xf33c,0xf33f,
+0xf3c0,0xf3c3,0xf3cc,0xf3cf,
+0xf3f0,0xf3f3,0xf3fc,0xf3ff,
+
+0xfc00,0xfc03,0xfc0c,0xfc0f,
+0xfc30,0xfc33,0xfc3c,0xfc3f,
+0xfcc0,0xfcc3,0xfccc,0xfccf,
+0xfcf0,0xfcf3,0xfcfc,0xfcff,
+
+0xff00,0xff03,0xff0c,0xff0f,
+0xff30,0xff33,0xff3c,0xff3f,
+0xffc0,0xffc3,0xffcc,0xffcf,
+0xfff0,0xfff3,0xfffc,0xffff};
+
+static int open_cfb2(struct display *p)
+{
+    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 2)
+	return -EINVAL;
+
+    p->next_line = p->var.xres_virtual>>2;
+    p->next_plane = 0;
+    MOD_INC_USE_COUNT;
+    return 0;
+}
+
+static void release_cfb2(void)
+{
+    MOD_DEC_USE_COUNT;
+}
+
+static void bmove_cfb2(struct display *p, int sy, int sx, int dy, int dx,
+                       int height, int width)
+{
+	int bytes = p->next_line, linesize = bytes * p->fontheight, rows;
+	u_char *src,*dst;
+
+	if (sx == 0 && dx == 0 && width * 2 == bytes) {
+		mymemmove(p->screen_base + dy * linesize,
+			  p->screen_base + sy * linesize,
+			  height * linesize);
+	}
+	else {
+		if (dy < sy || (dy == sy && dx < sx)) {
+			src = p->screen_base + sy * linesize + sx * 2;
+			dst = p->screen_base + dy * linesize + dx * 2;
+			for (rows = height * p->fontheight ; rows-- ;) {
+				mymemmove(dst, src, width * 2);
+				src += bytes;
+				dst += bytes;
+			}
+		}
+		else {
+			src = p->screen_base + (sy+height) * linesize + sx * 2
+				- bytes;
+			dst = p->screen_base + (dy+height) * linesize + dx * 2
+				- bytes;
+			for (rows = height * p->fontheight ; rows-- ;) {
+				mymemmove(dst, src, width * 2);
+				src -= bytes;
+				dst -= bytes;
+			}
+		}
+	}
+}
+
+static void clear_cfb2(struct vc_data *conp, struct display *p, int sy,
+                       int sx, int height, int width)
+{
+	u_char *dest0,*dest;
+	int bytes=p->next_line,lines=height * p->fontheight, rows, i;
+	u_long bgx;
+
+/*	if(p->screen_base!=0xFDD00020)
+		mac_boom(1);*/
+	dest = p->screen_base + sy * p->fontheight * bytes + sx * 2;
+
+	bgx=attr_bgcol_ec(p,conp);
+	bgx |= (bgx << 2);	/* expand the colour to 32bits */
+	bgx |= (bgx << 4);
+	bgx |= (bgx << 8);
+	bgx |= (bgx << 16);
+
+	if (sx == 0 && width * 2 == bytes) {
+		for (i = 0 ; i < lines * width ; i++) {
+			((u_long *)dest)[0]=bgx;
+			dest+=2;
+		}
+	} else {
+		dest0=dest;
+		for (rows = lines; rows-- ; dest0 += bytes) {
+			dest=dest0;
+			for (i = 0 ; i < width ; i++) {
+				/* memset ?? */
+				((u_long *)dest)[0]=bgx;
+				dest+=2;
+			}
+		}
+	}
+}
+
+static void putc_cfb2(struct vc_data *conp, struct display *p, int c, int yy,
+                      int xx)
+{
+	u_char *dest,*cdat;
+	int bytes=p->next_line,rows;
+	ulong eorx,fgx,bgx;
+
+	c &= 0xff;
+
+	dest = p->screen_base + yy * p->fontheight * bytes + xx * 4;
+	cdat = p->fontdata + c * p->fontheight;
+
+	fgx=3;/*attr_fgcol(p,conp)&0x0F;*/
+	bgx=attr_bgcol(p,conp)&0x0F;
+	fgx |= (fgx << 2);
+	fgx |= (fgx << 4);
+	fgx |= (fgx << 8);
+	bgx |= (bgx << 2);
+	bgx |= (bgx << 4);
+	bgx |= (bgx << 8);
+	eorx = fgx ^ bgx;
+
+	for (rows = p->fontheight ; rows-- ; dest += bytes) {
+		((u_short *)dest)[0]=
+			(nibbletab_cfb2[*cdat >> 6] & eorx) ^ bgx;
+		((u_short *)dest)[1]=
+			(nibbletab_cfb2[(*cdat >> 4) & 0x3] & eorx) ^ bgx;
+		((u_short *)dest)[2]=
+			(nibbletab_cfb2[(*cdat >> 2) & 0x3] & eorx) ^ bgx;
+		((u_short *)dest)[4]=
+			(nibbletab_cfb2[*cdat++ & 0x3] & eorx) ^ bgx;
+	}
+}
+
+static void putcs_cfb2(struct vc_data *conp, struct display *p,
+                       const char *s, int count, int yy, int xx)
+{
+	u_char *cdat, c, *dest, *dest0;
+	int rows,bytes=p->next_line;
+	u_long eorx, fgx, bgx;
+
+	dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 2;
+	fgx=3/*attr_fgcol(p,conp)*/;
+	bgx=attr_bgcol(p,conp);
+	fgx |= (fgx << 2);
+	fgx |= (fgx << 4);
+	fgx |= (fgx << 8);
+	fgx |= (fgx << 16);
+	bgx |= (bgx << 2);
+	bgx |= (bgx << 4);
+	bgx |= (bgx << 8);
+	bgx |= (bgx << 16);
+	eorx = fgx ^ bgx;
+	while (count--) {
+		c = *s++;
+		cdat = p->fontdata + c * p->fontheight;
+
+		for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
+			((u_short *)dest)[0]=
+			(nibbletab_cfb2[*cdat >> 6] & eorx) ^ bgx;
+			((u_short *)dest)[1]=
+				(nibbletab_cfb2[(*cdat >> 4) & 0x3] & eorx) ^ bgx;
+			((u_short *)dest)[2]=
+				(nibbletab_cfb2[(*cdat >> 2) & 0x3] & eorx) ^ bgx;
+			((u_short *)dest)[1]=
+			(nibbletab_cfb2[*cdat++ & 0x3] & eorx) ^ bgx;
+		}
+		dest0+=2;
+	}
+}
+
+static void rev_char_cfb2(struct display *p, int xx, int yy)
+{
+	u_char *dest;
+	int bytes=p->next_line, rows;
+
+	dest = p->screen_base + yy * p->fontheight * bytes + xx * 2;
+	for (rows = p->fontheight ; rows-- ; dest += bytes) {
+		((u_long *)dest)[0] ^= 0x33333333;
+	}
+}
+
+#ifdef MODULE
+int init_module(void)
+#else
+int fbcon_init_cfb2(void)
+#endif
+{
+    return(fbcon_register_driver(&dispsw_cfb2, 0));
+}
+
+#ifdef MODULE
+void cleanup_module(void)
+{
+    fbcon_unregister_driver(&dispsw_cfb2);
+}
+#endif /* MODULE */
+
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon-cfb32.c m68k-2.1.72/drivers/video/fbcon-cfb32.c
--- m68k-2.1.72-status/drivers/video/fbcon-cfb32.c	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/fbcon-cfb32.c	Wed Jan  7 22:03:28 1998
@@ -0,0 +1,243 @@
+/*
+ *  linux/drivers/video/cfb32.c -- Low level frame buffer operations for 32 bpp
+ *				   truecolor packed pixels
+ *
+ *	Created 28 Dec 1997 by Geert Uytterhoeven
+ *
+ *  This file is subject to the terms and conditions of the GNU General Public
+ *  License.  See the file COPYING in the main directory of this archive for
+ *  more details.
+ */
+
+#include <linux/module.h>
+#include <linux/tty.h>
+#include <linux/console.h>
+#include <linux/string.h>
+#include <linux/config.h>
+#include <linux/fb.h>
+
+#include "fbcon.h"
+
+
+    /*
+     *  Prototypes
+     */
+
+static int open_cfb32(struct display *p);
+static void release_cfb32(void);
+static void bmove_cfb32(struct display *p, int sy, int sx, int dy, int dx,
+			int height, int width);
+static void clear_cfb32(struct vc_data *conp, struct display *p, int sy,
+			int sx, int height, int width);
+static void putc_cfb32(struct vc_data *conp, struct display *p, int c,
+		       int yy, int xx);
+static void putcs_cfb32(struct vc_data *conp, struct display *p,
+			const char *s, int count, int yy, int xx);
+static void rev_char_cfb32(struct display *p, int xx, int yy);
+
+
+    /*
+     *  `switch' for the low level operations
+     */
+
+static struct display_switch dispsw_cfb32 = {
+    open_cfb32, release_cfb32, bmove_cfb32, clear_cfb32, putc_cfb32,
+    putcs_cfb32, rev_char_cfb32
+};
+
+
+    /*
+     *  32 bpp packed pixels
+     */
+
+u32 cfb32_cmap[16];
+
+static int open_cfb32(struct display *p)
+{
+    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 32 ||
+	(p->visual != FB_VISUAL_TRUECOLOR &&
+	 p->visual != FB_VISUAL_DIRECTCOLOR))
+	return -EINVAL;
+
+    p->next_line = p->var.xres_virtual<<2;
+    p->next_plane = 0;
+    MOD_INC_USE_COUNT;
+    return 0;
+}
+
+static void release_cfb32(void)
+{
+    MOD_DEC_USE_COUNT;
+}
+
+static void bmove_cfb32(struct display *p, int sy, int sx, int dy, int dx,
+			int height, int width)
+{
+    int bytes = p->next_line, linesize = bytes * p->fontheight, rows;
+    u_char *src, *dst;
+
+    if (sx == 0 && dx == 0 && width * 32 == bytes)
+	mymemmove(p->screen_base + dy * linesize,
+		  p->screen_base + sy * linesize,
+		  height * linesize);
+    else if (dy < sy || (dy == sy && dx < sx)) {
+	src = p->screen_base + sy * linesize + sx * 32;
+	dst = p->screen_base + dy * linesize + dx * 32;
+	for (rows = height * p->fontheight ; rows-- ;) {
+	    mymemmove(dst, src, width * 32);
+	    src += bytes;
+	    dst += bytes;
+	}
+    } else {
+	src = p->screen_base + (sy+height) * linesize + sx * 32 - bytes;
+	dst = p->screen_base + (dy+height) * linesize + dx * 32 - bytes;
+	for (rows = height * p->fontheight ; rows-- ;) {
+	    mymemmove(dst, src, width * 32);
+	    src -= bytes;
+	    dst -= bytes;
+	}
+    }
+}
+
+static void clear_cfb32(struct vc_data *conp, struct display *p, int sy,
+			int sx, int height, int width)
+{
+    u_char *dest0, *dest;
+    int bytes = p->next_line, lines = height * p->fontheight, rows, i;
+    u32 bgx;
+
+    dest = p->screen_base + sy * p->fontheight * bytes + sx * 32;
+
+    bgx = cfb32_cmap[attr_bgcol_ec(p, conp)];
+
+    if (sx == 0 && width * 32 == bytes)
+	for (i = 0 ; i < lines * width ; i++) {
+	    ((u32 *)dest)[0] = bgx;
+	    ((u32 *)dest)[1] = bgx;
+	    ((u32 *)dest)[2] = bgx;
+	    ((u32 *)dest)[3] = bgx;
+	    ((u32 *)dest)[4] = bgx;
+	    ((u32 *)dest)[5] = bgx;
+	    ((u32 *)dest)[6] = bgx;
+	    ((u32 *)dest)[7] = bgx;
+	    dest += 32;
+	}
+    else {
+	dest0 = dest;
+	for (rows = lines; rows-- ; dest0 += bytes) {
+	    dest = dest0;
+	    for (i = 0 ; i < width ; i++) {
+		((u32 *)dest)[0] = bgx;
+		((u32 *)dest)[1] = bgx;
+		((u32 *)dest)[2] = bgx;
+		((u32 *)dest)[3] = bgx;
+		((u32 *)dest)[4] = bgx;
+		((u32 *)dest)[5] = bgx;
+		((u32 *)dest)[6] = bgx;
+		((u32 *)dest)[7] = bgx;
+		dest += 32;
+	    }
+	}
+    }
+}
+
+static void putc_cfb32(struct vc_data *conp, struct display *p, int c, int yy,
+		       int xx)
+{
+    u_char *dest, *cdat;
+    int bytes = p->next_line, rows;
+    u32 eorx, fgx, bgx;
+
+    c &= 0xff;
+
+    dest = p->screen_base + yy * p->fontheight * bytes + xx * 32;
+    cdat = p->fontdata + c * p->fontheight;
+
+    fgx = cfb32_cmap[attr_fgcol(p, conp)];
+    bgx = cfb32_cmap[attr_bgcol(p, conp)];
+    eorx = fgx ^ bgx;
+
+    for (rows = p->fontheight ; rows-- ; dest += bytes) {
+	u_char bits = *cdat++;
+	((u32 *)dest)[0] = (-(bits >> 7) & eorx) ^ bgx;
+	((u32 *)dest)[1] = (-(bits >> 6 & 1) & eorx) ^ bgx;
+	((u32 *)dest)[2] = (-(bits >> 5 & 1) & eorx) ^ bgx;
+	((u32 *)dest)[3] = (-(bits >> 4 & 1) & eorx) ^ bgx;
+	((u32 *)dest)[4] = (-(bits >> 3 & 1) & eorx) ^ bgx;
+	((u32 *)dest)[5] = (-(bits >> 2 & 1) & eorx) ^ bgx;
+	((u32 *)dest)[6] = (-(bits >> 1 & 1) & eorx) ^ bgx;
+	((u32 *)dest)[7] = (-(bits & 1) & eorx) ^ bgx;
+    }
+}
+
+static void putcs_cfb32(struct vc_data *conp, struct display *p, const char *s,
+			int count, int yy, int xx)
+{
+    u_char *cdat, c, *dest, *dest0;
+    int rows, bytes = p->next_line;
+    u32 eorx, fgx, bgx;
+
+    dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 32;
+    fgx = cfb32_cmap[attr_fgcol(p, conp)];
+    bgx = cfb32_cmap[attr_bgcol(p, conp)];
+    eorx = fgx ^ bgx;
+    while (count--) {
+	c = *s++;
+	cdat = p->fontdata + c * p->fontheight;
+
+	for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
+	    u_char bits = *cdat++;
+	    ((u32 *)dest)[0] = (-(bits >> 7) & eorx) ^ bgx;
+	    ((u32 *)dest)[1] = (-(bits >> 6 & 1) & eorx) ^ bgx;
+	    ((u32 *)dest)[2] = (-(bits >> 5 & 1) & eorx) ^ bgx;
+	    ((u32 *)dest)[3] = (-(bits >> 4 & 1) & eorx) ^ bgx;
+	    ((u32 *)dest)[4] = (-(bits >> 3 & 1) & eorx) ^ bgx;
+	    ((u32 *)dest)[5] = (-(bits >> 2 & 1) & eorx) ^ bgx;
+	    ((u32 *)dest)[6] = (-(bits >> 1 & 1) & eorx) ^ bgx;
+	    ((u32 *)dest)[7] = (-(bits & 1) & eorx) ^ bgx;
+	}
+	dest0 += 32;
+    }
+}
+
+static void rev_char_cfb32(struct display *p, int xx, int yy)
+{
+    u_char *dest;
+    int bytes = p->next_line, rows;
+
+    dest = p->screen_base + yy * p->fontheight * bytes + xx * 32;
+    for (rows = p->fontheight ; rows-- ; dest += bytes) {
+	((u32 *)dest)[0] ^= 0xffffffff;
+	((u32 *)dest)[1] ^= 0xffffffff;
+	((u32 *)dest)[2] ^= 0xffffffff;
+	((u32 *)dest)[3] ^= 0xffffffff;
+	((u32 *)dest)[4] ^= 0xffffffff;
+	((u32 *)dest)[5] ^= 0xffffffff;
+	((u32 *)dest)[6] ^= 0xffffffff;
+	((u32 *)dest)[7] ^= 0xffffffff;
+    }
+}
+
+
+#ifdef MODULE
+int init_module(void)
+#else
+int fbcon_init_cfb32(void)
+#endif
+{
+    return(fbcon_register_driver(&dispsw_cfb32, 0));
+}
+
+#ifdef MODULE
+void cleanup_module(void)
+{
+    fbcon_unregister_driver(&dispsw_cfb32);
+}
+#endif /* MODULE */
+
+
+    /*
+     *  Visible symbols for modules
+     */
+
+EXPORT_SYMBOL(cfb32_cmap);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon-cfb4.c m68k-2.1.72/drivers/video/fbcon-cfb4.c
--- m68k-2.1.72-status/drivers/video/fbcon-cfb4.c	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/fbcon-cfb4.c	Wed Jan  7 22:03:28 1998
@@ -0,0 +1,237 @@
+/*
+ *  linux/drivers/video/cfb4.c -- Low level frame buffer operations for 4 bpp
+ *				  packed pixels
+ *
+ *	Created 26 Dec 1997 by Michael Schmitz
+ *	Based on the old macfb.c 4bpp code by Alan Cox
+ *
+ *  This file is subject to the terms and conditions of the GNU General Public
+ *  License.  See the file COPYING in the main directory of this archive for
+ *  more details.
+ */
+
+#include <linux/module.h>
+#include <linux/tty.h>
+#include <linux/console.h>
+#include <linux/string.h>
+#include <linux/config.h>
+#include <linux/fb.h>
+
+#include "fbcon.h"
+
+
+    /*
+     *  Prototypes
+     */
+
+static int open_cfb4(struct display *p);
+static void release_cfb4(void);
+static void bmove_cfb4(struct display *p, int sy, int sx, int dy, int dx,
+		       int height, int width);
+static void clear_cfb4(struct vc_data *conp, struct display *p, int sy,
+		       int sx, int height, int width);
+static void putc_cfb4(struct vc_data *conp, struct display *p, int c, int yy,
+		      int xx);
+static void putcs_cfb4(struct vc_data *conp, struct display *p,
+		       const char *s, int count, int yy, int xx);
+static void rev_char_cfb4(struct display *p, int xx, int yy);
+
+
+    /*
+     *  `switch' for the low level operations
+     */
+
+static struct display_switch dispsw_cfb4 = {
+    open_cfb4, release_cfb4, bmove_cfb4, clear_cfb4, putc_cfb4, putcs_cfb4,
+    rev_char_cfb4
+};
+
+
+    /*
+     *  4 bpp packed pixels
+     */
+
+   /*
+    *		IFF the font is even pixel aligned (that is to say each
+    *		character start is a byte start in the pixel pairs). That
+    *		avoids us having to mask bytes and means we won't be here
+    *		all week. On a MacII that matters _lots_
+    */
+
+static u_short nibbletab_cfb4[]={
+0x0000,0x000f,0x00f0,0x00ff,
+0x0f00,0x0f0f,0x0ff0,0x0fff,
+0xf000,0xf00f,0xf0f0,0xf0ff,
+0xff00,0xff0f,0xfff0,0xffff};
+
+static int open_cfb4(struct display *p)
+{
+    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 4)
+	return -EINVAL;
+
+    p->next_line = p->var.xres_virtual>>1;
+    p->next_plane = 0;
+    MOD_INC_USE_COUNT;
+    return 0;
+}
+
+static void release_cfb4(void)
+{
+    MOD_DEC_USE_COUNT;
+}
+
+static void bmove_cfb4(struct display *p, int sy, int sx, int dy, int dx,
+                       int height, int width)
+{
+	int bytes = p->next_line, linesize = bytes * p->fontheight, rows;
+	u_char *src,*dst;
+
+	if (sx == 0 && dx == 0 && width * 4 == bytes) {
+		mymemmove(p->screen_base + dy * linesize,
+			  p->screen_base + sy * linesize,
+			  height * linesize);
+	}
+	else {
+		if (dy < sy || (dy == sy && dx < sx)) {
+			src = p->screen_base + sy * linesize + sx * 4;
+			dst = p->screen_base + dy * linesize + dx * 4;
+			for (rows = height * p->fontheight ; rows-- ;) {
+				mymemmove(dst, src, width * 4);
+				src += bytes;
+				dst += bytes;
+			}
+		}
+		else {
+			src = p->screen_base + (sy+height) * linesize + sx * 4
+				- bytes;
+			dst = p->screen_base + (dy+height) * linesize + dx * 4
+				- bytes;
+			for (rows = height * p->fontheight ; rows-- ;) {
+				mymemmove(dst, src, width * 4);
+				src -= bytes;
+				dst -= bytes;
+			}
+		}
+	}
+}
+
+static void clear_cfb4(struct vc_data *conp, struct display *p, int sy,
+                       int sx, int height, int width)
+{
+	u_char *dest0,*dest;
+	int bytes=p->next_line,lines=height * p->fontheight, rows, i;
+	u_long bgx;
+
+/*	if(p->screen_base!=0xFDD00020)
+		mac_boom(1);*/
+	dest = p->screen_base + sy * p->fontheight * bytes + sx * 4;
+
+	bgx=attr_bgcol_ec(p,conp);
+	bgx |= (bgx << 4);	/* expand the colour to 32bits */
+	bgx |= (bgx << 8);
+	bgx |= (bgx << 16);
+
+	if (sx == 0 && width * 4 == bytes) {
+		for (i = 0 ; i < lines * width ; i++) {
+			((u_long *)dest)[0]=bgx;
+			dest+=4;
+		}
+	} else {
+		dest0=dest;
+		for (rows = lines; rows-- ; dest0 += bytes) {
+			dest=dest0;
+			for (i = 0 ; i < width ; i++) {
+				/* memset ?? */
+				((u_long *)dest)[0]=bgx;
+				dest+=4;
+			}
+		}
+	}
+}
+
+static void putc_cfb4(struct vc_data *conp, struct display *p, int c, int yy,
+                      int xx)
+{
+	u_char *dest,*cdat;
+	int bytes=p->next_line,rows;
+	ulong eorx,fgx,bgx;
+
+	c &= 0xff;
+
+	dest = p->screen_base + yy * p->fontheight * bytes + xx * 4;
+	cdat = p->fontdata + c * p->fontheight;
+
+	fgx=15;/*attr_fgcol(p,conp)&0x0F;*/
+	bgx=attr_bgcol(p,conp)&0x0F;
+	fgx |= (fgx << 4);
+	fgx |= (fgx << 8);
+	bgx |= (bgx << 4);
+	bgx |= (bgx << 8);
+	eorx = fgx ^ bgx;
+
+	for (rows = p->fontheight ; rows-- ; dest += bytes) {
+		((u_short *)dest)[0]=
+			(nibbletab_cfb4[*cdat >> 4] & eorx) ^ bgx;
+		((u_short *)dest)[1]=
+			(nibbletab_cfb4[*cdat++ & 0xf] & eorx) ^ bgx;
+	}
+}
+
+static void putcs_cfb4(struct vc_data *conp, struct display *p,
+                       const char *s, int count, int yy, int xx)
+{
+	u_char *cdat, c, *dest, *dest0;
+	int rows,bytes=p->next_line;
+	u_long eorx, fgx, bgx;
+
+	dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 4;
+	fgx=15/*attr_fgcol(p,conp)*/;
+	bgx=attr_bgcol(p,conp);
+	fgx |= (fgx << 4);
+	fgx |= (fgx << 8);
+	fgx |= (fgx << 16);
+	bgx |= (bgx << 4);
+	bgx |= (bgx << 8);
+	bgx |= (bgx << 16);
+	eorx = fgx ^ bgx;
+	while (count--) {
+		c = *s++;
+		cdat = p->fontdata + c * p->fontheight;
+
+		for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
+			((u_short *)dest)[0]=
+			(nibbletab_cfb4[*cdat >> 4] & eorx) ^ bgx;
+			((u_short *)dest)[1]=
+			(nibbletab_cfb4[*cdat++ & 0xf] & eorx) ^ bgx;
+		}
+		dest0+=4;
+	}
+}
+
+static void rev_char_cfb4(struct display *p, int xx, int yy)
+{
+	u_char *dest;
+	int bytes=p->next_line, rows;
+
+	dest = p->screen_base + yy * p->fontheight * bytes + xx * 4;
+	for (rows = p->fontheight ; rows-- ; dest += bytes) {
+		((u_long *)dest)[0] ^= 0x0f0f0f0f;
+	}
+}
+
+#ifdef MODULE
+int init_module(void)
+#else
+int fbcon_init_cfb4(void)
+#endif
+{
+    return(fbcon_register_driver(&dispsw_cfb4, 0));
+}
+
+#ifdef MODULE
+void cleanup_module(void)
+{
+    fbcon_unregister_driver(&dispsw_cfb4);
+}
+#endif /* MODULE */
+
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon-cfb8.c m68k-2.1.72/drivers/video/fbcon-cfb8.c
--- m68k-2.1.72-status/drivers/video/fbcon-cfb8.c	Tue Nov 11 17:52:28 1997
+++ m68k-2.1.72/drivers/video/fbcon-cfb8.c	Wed Jan  7 22:03:28 1998
@@ -50,16 +50,27 @@
      *  8 bpp packed pixels
      */
 
-static u_long nibbletab_cfb8[] = {
+static u32 nibbletab_cfb8[] = {
+#if defined(__BIG_ENDIAN)
     0x00000000,0x000000ff,0x0000ff00,0x0000ffff,
     0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff,
     0xff000000,0xff0000ff,0xff00ff00,0xff00ffff,
     0xffff0000,0xffff00ff,0xffffff00,0xffffffff
+#elif defined(__LITTLE_ENDIAN)
+    0x00000000,0xff000000,0x00ff0000,0xffff0000,
+    0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00,
+    0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff,
+    0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff
+#else
+#error FIXME: No endianness??
+#endif
 };
 
 static int open_cfb8(struct display *p)
 {
-    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 8)
+    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 8 ||
+	(p->visual != FB_VISUAL_PSEUDOCOLOR &&
+	 p->visual != FB_VISUAL_STATIC_PSEUDOCOLOR))
 	return -EINVAL;
 
     p->next_line = p->var.xres_virtual;
@@ -107,7 +118,7 @@
 {
     u_char *dest0,*dest;
     int bytes=p->next_line,lines=height * p->fontheight, rows, i;
-    u_long bgx;
+    u32 bgx;
 
     dest = p->screen_base + sy * p->fontheight * bytes + sx * 8;
 
@@ -117,8 +128,8 @@
 
     if (sx == 0 && width * 8 == bytes)
 	for (i = 0 ; i < lines * width ; i++) {
-	    ((u_long *)dest)[0]=bgx;
-	    ((u_long *)dest)[1]=bgx;
+	    ((u32 *)dest)[0]=bgx;
+	    ((u32 *)dest)[1]=bgx;
 	    dest+=8;
 	}
     else {
@@ -126,8 +137,8 @@
 	for (rows = lines; rows-- ; dest0 += bytes) {
 	    dest=dest0;
 	    for (i = 0 ; i < width ; i++) {
-		((u_long *)dest)[0]=bgx;
-		((u_long *)dest)[1]=bgx;
+		((u32 *)dest)[0]=bgx;
+		((u32 *)dest)[1]=bgx;
 		dest+=8;
 	    }
 	}
@@ -139,7 +150,7 @@
 {
     u_char *dest,*cdat;
     int bytes=p->next_line,rows;
-    ulong eorx,fgx,bgx;
+    u32 eorx,fgx,bgx;
 
     c &= 0xff;
 
@@ -155,8 +166,8 @@
     eorx = fgx ^ bgx;
 
     for (rows = p->fontheight ; rows-- ; dest += bytes) {
-	((u_long *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
-	((u_long *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx;
+	((u32 *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
+	((u32 *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx;
     }
 }
 
@@ -165,7 +176,7 @@
 {
     u_char *cdat, c, *dest, *dest0;
     int rows,bytes=p->next_line;
-    u_long eorx, fgx, bgx;
+    u32 eorx, fgx, bgx;
 
     dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 8;
     fgx=attr_fgcol(p,conp);
@@ -180,9 +191,8 @@
 	cdat = p->fontdata + c * p->fontheight;
 
 	for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
-	    ((u_long *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
-	    ((u_long *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^
-				 bgx;
+	    ((u32 *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
+	    ((u32 *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx;
 	}
 	dest0+=8;
     }
@@ -195,8 +205,8 @@
 
     dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
     for (rows = p->fontheight ; rows-- ; dest += bytes) {
-	((u_long *)dest)[0] ^= 0x0f0f0f0f;
-	((u_long *)dest)[1] ^= 0x0f0f0f0f;
+	((u32 *)dest)[0] ^= 0x0f0f0f0f;
+	((u32 *)dest)[1] ^= 0x0f0f0f0f;
     }
 }
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon-cyber.c m68k-2.1.72/drivers/video/fbcon-cyber.c
--- m68k-2.1.72-status/drivers/video/fbcon-cyber.c	Tue Nov 11 17:52:29 1997
+++ m68k-2.1.72/drivers/video/fbcon-cyber.c	Wed Jan  7 22:03:28 1998
@@ -67,6 +67,22 @@
      *  CyberVision64 (accelerated)
      */
 
+static u32 nibbletab_cfb8[] = {
+#if defined(__BIG_ENDIAN)
+    0x00000000,0x000000ff,0x0000ff00,0x0000ffff,
+    0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff,
+    0xff000000,0xff0000ff,0xff00ff00,0xff00ffff,
+    0xffff0000,0xffff00ff,0xffffff00,0xffffffff
+#elif defined(__LITTLE_ENDIAN)
+    0x00000000,0xff000000,0x00ff0000,0xffff0000,
+    0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00,
+    0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff,
+    0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff
+#else
+#error FIXME: No endianness??
+#endif
+};
+
 static int open_cyber(struct display *p)
 {
     if (p->type != FB_TYPE_PACKED_PIXELS ||
@@ -111,80 +127,52 @@
 static void putc_cyber(struct vc_data *conp, struct display *p, int c, int yy,
 	               int xx)
 {
-    u_char *dest, *cdat;
-    u_long tmp;
-    u_int rows, revs, underl;
-    u_char d;
-    u_char fg, bg;
+    u_char *dest,*cdat;
+    int bytes=p->next_line,rows;
+    u32 eorx,fgx,bgx;
 
     c &= 0xff;
 
-    dest = p->screen_base+yy*p->fontheight*p->next_line+8*xx;
-    cdat = p->fontdata+(c*p->fontheight);
-    fg = p->fgcol;
-    bg = p->bgcol;
-    revs = conp->vc_reverse;
-    underl = conp->vc_underline;
-
-    Cyber_WaitBlit();
-    for (rows = p->fontheight; rows--; dest += p->next_line) {
-	d = *cdat++;
-
-	if (underl && !rows)
-	    d = 0xff;
-	if (revs)
-	    d = ~d;
-
-	tmp =  ((d & 0x80) ? fg : bg) << 24;
-	tmp |= ((d & 0x40) ? fg : bg) << 16;
-	tmp |= ((d & 0x20) ? fg : bg) << 8;
-	tmp |= ((d & 0x10) ? fg : bg);
-	*((u_long*) dest) = tmp;
-	tmp =  ((d & 0x8) ? fg : bg) << 24;
-	tmp |= ((d & 0x4) ? fg : bg) << 16;
-	tmp |= ((d & 0x2) ? fg : bg) << 8;
-	tmp |= ((d & 0x1) ? fg : bg);
-	*((u_long*) dest + 1) = tmp;
+    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
+    cdat = p->fontdata + c * p->fontheight;
+
+    fgx=attr_fgcol(p,conp);
+    bgx=attr_bgcol(p,conp);
+    fgx |= (fgx << 8);
+    fgx |= (fgx << 16);
+    bgx |= (bgx << 8);
+    bgx |= (bgx << 16);
+    eorx = fgx ^ bgx;
+
+    for (rows = p->fontheight ; rows-- ; dest += bytes) {
+	((u32 *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
+	((u32 *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx;
     }
 }
 
 static void putcs_cyber(struct vc_data *conp, struct display *p, const char *s,
 	                int count, int yy, int xx)
 {
-    u_char *dest, *dest0, *cdat;
-    u_long tmp;
-    u_int rows, underl;
-    u_char c, d;
-    u_char fg, bg;
-
-    dest0 = p->screen_base+yy*p->fontheight*p->next_line+8*xx;
-    fg = p->fgcol;
-    bg = p->bgcol;
-    underl = conp->vc_underline;
-
-    Cyber_WaitBlit();
+    u_char *cdat, c, *dest, *dest0;
+    int rows,bytes=p->next_line;
+    u32 eorx, fgx, bgx;
+
+    dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 8;
+    fgx=attr_fgcol(p,conp);
+    bgx=attr_bgcol(p,conp);
+    fgx |= (fgx << 8);
+    fgx |= (fgx << 16);
+    bgx |= (bgx << 8);
+    bgx |= (bgx << 16);
+    eorx = fgx ^ bgx;
     while (count--) {
 	c = *s++;
-	dest = dest0;
-	dest0 += 8;
-	cdat = p->fontdata+(c*p->fontheight);
-	for (rows = p->fontheight; rows--; dest += p->next_line) {
-	    d = *cdat++;
-
-	    if (underl && !rows)
-		d = 0xff;
-
-	    tmp =  ((d & 0x80) ? fg : bg) << 24;
-	    tmp |= ((d & 0x40) ? fg : bg) << 16;
-	    tmp |= ((d & 0x20) ? fg : bg) << 8;
-	    tmp |= ((d & 0x10) ? fg : bg);
-	    *((u_long*) dest) = tmp;
-	    tmp =  ((d & 0x8) ? fg : bg) << 24;
-	    tmp |= ((d & 0x4) ? fg : bg) << 16;
-	    tmp |= ((d & 0x2) ? fg : bg) << 8;
-	    tmp |= ((d & 0x1) ? fg : bg);
-	    *((u_long*) dest + 1) = tmp;
+	cdat = p->fontdata + c * p->fontheight;
+	for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
+	    ((u32 *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
+	    ((u32 *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx;
 	}
+	dest0+=8;
     }
 }
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon-ilbm.c m68k-2.1.72/drivers/video/fbcon-ilbm.c
--- m68k-2.1.72-status/drivers/video/fbcon-ilbm.c	Tue Nov 11 17:52:30 1997
+++ m68k-2.1.72/drivers/video/fbcon-ilbm.c	Thu Jan  8 00:00:08 1998
@@ -188,7 +188,7 @@
     u_char *dest0, *dest, *cdat1, *cdat2, *cdat3, *cdat4;
     u_int rows, i;
     u_char c1, c2, c3, c4;
-    u_long d;
+    u32 d;
     int fg0, bg0, fg, bg;
 
     dest0 = p->screen_base+yy*p->fontheight*p->next_line+xx;
@@ -233,20 +233,26 @@
 	    cdat3 = p->fontdata+c3*p->fontheight;
 	    cdat4 = p->fontdata+c4*p->fontheight;
 	    for (rows = p->fontheight; rows--;) {
+#if defined(__BIG_ENDIAN)
 		d = *cdat1++<<24 | *cdat2++<<16 | *cdat3++<<8 | *cdat4++;
+#elif defined(__LITTLE_ENDIAN)
+		d = *cdat1++ | *cdat2++<<8 | *cdat3++<<16 | *cdat4++<<32);
+#else
+#error FIXME: No endianness??
+#endif
 		fg = fg0;
 		bg = bg0;
 		for (i = p->var.bits_per_pixel; i--; dest += p->next_plane) {
 		    if (bg & 1)
 			if (fg & 1)
-			    *(u_long *)dest = 0xffffffff;
+			    *(u32 *)dest = 0xffffffff;
 			else
-			    *(u_long *)dest = ~d;
+			    *(u32 *)dest = ~d;
 		    else
 			if (fg & 1)
-			    *(u_long *)dest = d;
+			    *(u32 *)dest = d;
 			else
-			    *(u_long *)dest = 0x00000000;
+			    *(u32 *)dest = 0x00000000;
 		    bg >>= 1;
 		    fg >>= 1;
 		}
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon-mac.c m68k-2.1.72/drivers/video/fbcon-mac.c
--- m68k-2.1.72-status/drivers/video/fbcon-mac.c	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/fbcon-mac.c	Wed Jan  7 22:03:28 1998
@@ -0,0 +1,538 @@
+/*
+ *  linux/drivers/video/fbcon-mac.c -- Low level frame buffer operations for 
+ *				       x bpp packed pixels, font width != 8
+ *
+ *	Created 26 Dec 1997 by Michael Schmitz
+ *	Based on the old macfb.c 6x11 code by Randy Thelen
+ *
+ *	This driver is significantly slower than the 8bit font drivers 
+ *	and would probably benefit from splitting into drivers for each depth.
+ *
+ *  This file is subject to the terms and conditions of the GNU General Public
+ *  License.  See the file COPYING in the main directory of this archive for
+ */
+
+#include <linux/module.h>
+#include <linux/tty.h>
+#include <linux/console.h>
+#include <linux/string.h>
+#include <linux/config.h>
+#include <linux/fb.h>
+#include <linux/delay.h>
+
+#include "fbcon.h"
+
+
+    /*
+     *  Prototypes
+     */
+
+static int open_mac(struct display *p);
+static void release_mac(void);
+static void bmove_mac(struct display *p, int sy, int sx, int dy, int dx,
+		       int height, int width);
+static void clear_mac(struct vc_data *conp, struct display *p, int sy,
+		       int sx, int height, int width);
+static void putc_mac(struct vc_data *conp, struct display *p, int c, int yy,
+		      int xx);
+static void putcs_mac(struct vc_data *conp, struct display *p,
+		       const char *s, int count, int yy, int xx);
+static void rev_char_mac(struct display *p, int xx, int yy);
+
+
+    /*
+     *  `switch' for the low level operations
+     */
+
+static struct display_switch dispsw_mac = {
+    open_mac, release_mac, bmove_mac, clear_mac, putc_mac, putcs_mac,
+    rev_char_mac
+};
+
+
+    /*
+     *  variable bpp packed pixels
+     */
+
+static int open_mac(struct display *p)
+{
+    if (p->type != FB_TYPE_PACKED_PIXELS || p->fontwidth == 8)
+	return -EINVAL;
+
+    if (p->line_length)
+	p->next_line = p->line_length;
+    else
+    	p->next_line = p->var.xres_virtual>>3;
+    p->next_plane = 0;
+    MOD_INC_USE_COUNT;
+    return 0;
+}
+
+static void release_mac(void)
+{
+    MOD_DEC_USE_COUNT;
+}
+
+   /*
+    *    Macintosh
+    */
+#define PIXEL_BLACK_MAC          0
+#define PIXEL_WHITE_MAC          1
+#define PIXEL_INVERT_MAC         2
+
+static void bmove_mac(struct display *p, int sy, int sx, int dy, int dx,
+                       int height, int width)
+{
+   int i, j;
+   u_char *dest, *src;
+   int l,r,t,b,w,lo,s;
+   int dl,dr,dt,db,dw,dlo;
+   int move_up;
+
+   src = (u_char *) (p->screen_base + sy * p->fontheight * p->next_line);
+   dest = (u_char *) (p->screen_base + dy * p->fontheight * p->next_line);
+
+   if( sx == 0 && width == p->conp->vc_cols) {
+     s = height * p->fontheight * p->next_line;
+     mymemmove(dest, src, s);
+     return;
+   }
+   
+   l = sx * p->fontwidth;
+   r = l + width * p->fontwidth;
+   t = sy * p->fontheight;
+   b = t + height * p->fontheight;
+
+   dl = dx * p->fontwidth;
+   dr = dl + width * p->fontwidth;
+   dt = dy * p->fontheight;
+   db = dt + height * p->fontheight;
+
+   /* w is the # pixels between two long-aligned points, left and right */
+   w = (r&~31) - ((l+31)&~31);
+   dw = (dr&~31) - ((dl+31)&~31);
+   /* lo is the # pixels between the left edge and a long-aligned left pixel */
+   lo = ((l+31)&~31) - l;
+   dlo = ((dl+31)&~31) - dl;
+   
+   /* if dx != sx then, logic has to align the left and right edges for fast moves */
+   if (lo != dlo) {
+     lo = ((l+7)&~7) - l;
+     dlo = ((dl+7)&~7) - dl;
+     w = (r&~7) - ((l+7)&~7);
+     dw = (dr&~7) - ((dl+7)&~7);
+     if (lo != dlo) {
+       char err_str[256];
+       unsigned long cnt;
+       sprintf( err_str, "ERROR: Shift algorithm: sx=%d,sy=%d,dx=%d,dy=%d,w=%d,h=%d,bpp=%d",
+		sx,sy,dx,dy,width,height,p->var.bits_per_pixel);
+       putcs_mac(p->conp, p, err_str, strlen(err_str), 0, 0);
+       /* pause for the user */
+       for(cnt = 0; cnt < 50000; cnt++)
+		udelay(100);
+       return;
+     }
+   }
+
+   s = 0;
+   switch (p->var.bits_per_pixel) {
+   case 1:
+     s = w >> 3;
+     src += lo >> 3;
+     dest += lo >> 3;
+     break;
+   case 2:
+     s = w >> 2;
+     src += lo >> 2;
+     dest += lo >> 2;
+     break;
+   case 4:
+     s = w >> 1;
+     src += lo >> 1;
+     dest += lo >> 1;
+     break;
+   case 8:
+     s = w;
+     src += lo;
+     dest += lo;
+     break;
+   case 16:
+     s = w << 1;
+     src += lo << 1;
+     dest += lo << 1;
+     break;
+   case 32:
+     s = w << 2;
+     src += lo << 2;
+     dest += lo << 2;
+     break;
+   }
+
+   if (sy <= sx) {
+     i = b;
+     move_up = 0;
+     src += height * p->fontheight;
+     dest += height * p->fontheight;
+   } else {
+     i = t;
+     move_up = 1;
+   }
+
+   while (1) {
+     for (i = t; i < b; i++) {
+       j = l;
+
+       for (; j & 31 && j < r; j++)
+	 plot_pixel_mac(p, get_pixel_mac(p, j+(dx-sx), i+(dy-sy)), j, i);
+
+       if (j < r) {
+	 mymemmove(dest, src, s);
+	 if (move_up) {
+	   dest += p->next_line;
+	   src += p->next_line;
+	 } else {
+	   dest -= p->next_line;
+	   src -= p->next_line;
+	 }
+	 j += w;
+       }
+     
+       for (; j < r; j++)
+	 plot_pixel_mac(p, get_pixel_mac(p, j+(dx-sx), i+(dy-sy)), j, i);
+     }
+
+     if (move_up) {
+       i++;
+       if (i >= b)
+	 break;
+     } else {
+       i--;
+       if (i < t)
+	 break;
+     }
+   }
+}
+
+
+static void clear_mac(struct vc_data *conp, struct display *p, int sy, int sx,
+                       int height, int width)
+{
+   int pixel;
+   int i, j;
+   int inverse;
+   u_char *dest;
+   int l,r,t,b,w,lo,s;
+
+   inverse = attr_reverse(p,conp);
+   pixel = inverse ? PIXEL_WHITE_MAC : PIXEL_BLACK_MAC;
+   dest = (u_char *) (p->screen_base + sy * p->fontheight * p->next_line);
+
+   if( sx == 0 && width == p->conp->vc_cols) {
+     s = height * p->fontheight * p->next_line;
+     if (inverse)
+       mymemclear(dest, s);
+     else
+       mymemset(dest, s);
+   }
+   
+   l = sx * p->fontwidth;
+   r = l + width * p->fontwidth;
+   t = sy * p->fontheight;
+   b = t + height * p->fontheight;
+   /* w is the # pixels between two long-aligned points, left and right */
+   w = (r&~31) - ((l+31)&~31);
+   /* lo is the # pixels between the left edge and a long-aligned left pixel */
+   lo = ((l+31)&~31) - l;
+   s = 0;
+   switch (p->var.bits_per_pixel) {
+   case 1:
+     s = w >> 3;
+     dest += lo >> 3;
+     break;
+   case 2:
+     s = w >> 2;
+     dest += lo >> 2;
+     break;
+   case 4:
+     s = w >> 1;
+     dest += lo >> 1;
+     break;
+   case 8:
+     s = w;
+     dest += lo;
+     break;
+   case 16:
+     s = w << 1;
+     dest += lo << 1;
+     break;
+   case 32:
+     s = w << 2;
+     dest += lo << 2;
+     break;
+   }
+
+   for (i = t; i < b; i++) {
+     j = l;
+
+     for (; j & 31 && j < r; j++)
+       plot_pixel_mac(p, pixel, j, i);
+
+     if (j < r) {
+       if (PIXEL_WHITE_MAC == pixel)
+	 mymemclear(dest, s);
+       else
+	 mymemset(dest, s);
+       dest += p->next_line;
+       j += w;
+     }
+     
+     for (; j < r; j++)
+       plot_pixel_mac(p, pixel, j, i);
+   }
+}
+
+
+static void putc_mac(struct vc_data *conp, struct display *p, int c, int yy,
+                      int xx)
+{
+   u_char *cdat;
+   u_int rows, bold, ch_reverse, ch_underline;
+   u_char d;
+   int j;
+
+   c &= 0xff;
+
+   cdat = p->fontdata+c*p->fontheight;
+   bold = attr_bold(p,conp);
+   ch_reverse = attr_reverse(p,conp);
+   ch_underline = attr_underline(p,conp);
+
+   for (rows = 0; rows < p->fontheight; rows++) {
+      d = *cdat++;
+      if (!conp->vc_can_do_color) {
+	if (ch_underline && rows == (p->fontheight-2))
+	  d = 0xff;
+	else if (bold)
+	  d |= d>>1;
+	if (ch_reverse)
+	  d = ~d;
+      }
+      for (j = 0; j < p->fontwidth; j++) {
+	plot_pixel_mac(p, (d & 0x80) >> 7, (xx*p->fontwidth) + j, (yy*p->fontheight) + rows);
+	d <<= 1;
+      }
+   }
+}
+
+
+static void putcs_mac(struct vc_data *conp, struct display *p, const char *s,
+                       int count, int yy, int xx)
+{
+   u_char c;
+
+   while (count--) {
+      c = *s++;
+      putc_mac(conp, p, c, yy, xx++);
+   }
+}
+
+
+static void rev_char_mac(struct display *p, int xx, int yy)
+{
+   u_int rows, j;
+
+   for (rows = 0; rows < p->fontheight; rows++) {
+     for (j = 0; j < p->fontwidth; j++) {
+       plot_pixel_mac (p, PIXEL_INVERT_MAC, (xx*p->fontwidth)+j, (yy*p->fontheight)+rows);
+     }
+   }
+}
+
+/*
+ * plot_pixel_mac
+ *
+ * bw == 0 = black
+ *       1 = white
+ *       2 = invert
+ */
+static void plot_pixel_mac(struct display *p, int bw, int pixel_x, int pixel_y)
+{
+  u_char *dest, bit;
+  u_short *dest16, pix16;
+  u_long *dest32, pix32;
+
+  if (pixel_x < 0 || pixel_y < 0 || pixel_x >= 832 || pixel_y >= 624) {
+    int cnt;
+    printk ("ERROR: pixel_x == %d, pixel_y == %d", pixel_x, pixel_y);
+    for(cnt = 0; cnt < 100000; cnt++)
+        udelay(100);
+    return;
+  }
+
+  switch (p->var.bits_per_pixel) {
+  case 1:
+    dest = (u_char *) ((pixel_x >> 3) + p->screen_base + pixel_y * p->next_line);
+    bit = 0x80 >> (pixel_x & 7);
+    switch (bw) {
+    case PIXEL_BLACK_MAC:
+      *dest |= bit;
+      break;
+    case PIXEL_WHITE_MAC:
+      *dest &= ~bit;
+      break;
+    case PIXEL_INVERT_MAC:
+      *dest ^= bit;
+      break;
+    default:
+      printk( "ERROR: Unknown pixel value in plot_pixel_mac\n");
+    }
+    break;
+
+  case 2:
+    dest = (u_char *) ((pixel_x >> 2) + p->screen_base + pixel_y * p->next_line);
+    bit = 0xC0 >> ((pixel_x & 3) << 1);
+    switch (bw) {
+    case PIXEL_BLACK_MAC:
+      *dest |= bit;
+      break;
+    case PIXEL_WHITE_MAC:
+      *dest &= ~bit;
+      break;
+    case PIXEL_INVERT_MAC:
+      *dest ^= bit;
+      break;
+    default:
+      printk( "ERROR: Unknown pixel value in plot_pixel_mac\n");
+    }
+    break;
+
+  case 4:
+    dest = (u_char *) ((pixel_x / 2) + p->screen_base + pixel_y * p->next_line);
+    bit = 0xF0 >> ((pixel_x & 1) << 2);
+    switch (bw) {
+    case PIXEL_BLACK_MAC:
+      *dest |= bit;
+      break;
+    case PIXEL_WHITE_MAC:
+      *dest &= ~bit;
+      break;
+    case PIXEL_INVERT_MAC:
+      *dest ^= bit;
+      break;
+    default:
+      printk( "ERROR: Unknown pixel value in plot_pixel_mac\n");
+    }
+    break;
+
+  case 8:
+    dest = (u_char *) (pixel_x + p->screen_base + pixel_y * p->next_line);
+    bit = 0xFF;
+    switch (bw) {
+    case PIXEL_BLACK_MAC:
+      *dest |= bit;
+      break;
+    case PIXEL_WHITE_MAC:
+      *dest &= ~bit;
+      break;
+    case PIXEL_INVERT_MAC:
+      *dest ^= bit;
+      break;
+    default:
+      printk( "ERROR: Unknown pixel value in plot_pixel_mac\n");
+    }
+    break;
+
+  case 16:
+    dest16 = (u_short *) ((pixel_x *2) + p->screen_base + pixel_y * p->next_line);
+    pix16 = 0xFFFF;
+    switch (bw) {
+    case PIXEL_BLACK_MAC:
+      *dest16 = ~pix16;
+      break;
+    case PIXEL_WHITE_MAC:
+      *dest16 = pix16;
+      break;
+    case PIXEL_INVERT_MAC:
+      *dest16 ^= pix16;
+      break;
+    default:
+      printk( "ERROR: Unknown pixel value in plot_pixel_mac\n");
+    }
+    break;
+
+  case 32:
+    dest32 = (u_long *) ((pixel_x *4) + p->screen_base + pixel_y * p->next_line);
+    pix32 = 0xFFFFFFFF;
+    switch (bw) {
+    case PIXEL_BLACK_MAC:
+      *dest32 = ~pix32;
+      break;
+    case PIXEL_WHITE_MAC:
+      *dest32 = pix32;
+      break;
+    case PIXEL_INVERT_MAC:
+      *dest32 ^= pix32;
+      break;
+    default:
+      printk( "ERROR: Unknown pixel value in plot_pixel_mac\n");
+    }
+    break;
+  }
+}
+
+static int get_pixel_mac(struct display *p, int pixel_x, int pixel_y)
+{
+  u_char *dest, bit;
+  u_short *dest16;
+  u_long *dest32;
+  u_char pixel;
+
+  switch (p->var.bits_per_pixel) {
+  case 1:
+    dest = (u_char *) ((pixel_x / 8) + p->screen_base + pixel_y * p->next_line);
+    bit = 0x80 >> (pixel_x & 7);
+    pixel = *dest & bit;
+    break;
+  case 2:
+    dest = (u_char *) ((pixel_x / 4) + p->screen_base + pixel_y * p->next_line);
+    bit = 0xC0 >> (pixel_x & 3);
+    pixel = *dest & bit;
+    break;
+  case 4:
+    dest = (u_char *) ((pixel_x / 2) + p->screen_base + pixel_y * p->next_line);
+    bit = 0xF0 >> (pixel_x & 1);
+    pixel = *dest & bit;
+    break;
+  case 8:
+    dest = (u_char *) (pixel_x + p->screen_base + pixel_y * p->next_line);
+    pixel = *dest;
+    break;
+  case 16:
+    dest16 = (u_short *) ((pixel_x *2) + p->screen_base + pixel_y * p->next_line);
+    pixel = *dest16 ? 1 : 0;
+    break;
+  case 32:
+    dest32 = (u_long *) ((pixel_x *4) + p->screen_base + pixel_y * p->next_line);
+    pixel = *dest32 ? 1 : 0;
+    break;
+  }
+
+  return pixel ? PIXEL_BLACK_MAC : PIXEL_WHITE_MAC;
+}
+
+#ifdef MODULE
+int init_module(void)
+#else
+int fbcon_init_mac(void)
+#endif
+{
+    return(fbcon_register_driver(&dispsw_mac, 0));
+}
+
+#ifdef MODULE
+void cleanup_module(void)
+{
+    fbcon_unregister_driver(&dispsw_mac);
+}
+#endif /* MODULE */
+
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon-mach64.c m68k-2.1.72/drivers/video/fbcon-mach64.c
--- m68k-2.1.72-status/drivers/video/fbcon-mach64.c	Wed Dec 17 23:56:19 1997
+++ m68k-2.1.72/drivers/video/fbcon-mach64.c	Wed Jan  7 22:03:28 1998
@@ -124,10 +124,19 @@
 
 static u_int nibbletab_mach64[16] = 
 {
-  0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff,
-  0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff,
-  0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff,
-  0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff
+#if defined(__BIG_ENDIAN)
+  0x00000000,0x000000ff,0x0000ff00,0x0000ffff,
+  0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff,
+  0xff000000,0xff0000ff,0xff00ff00,0xff00ffff,
+  0xffff0000,0xffff00ff,0xffffff00,0xffffffff
+#elif defined(__LITTLE_ENDIAN)
+  0x00000000,0xff000000,0x00ff0000,0xffff0000,
+  0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00,
+  0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff,
+  0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff
+#else
+#error FIXME: No endianness??
+#endif
 };
 
 static  unsigned int    mach64_debug = 0x018FCF00;
@@ -372,8 +381,8 @@
   for(rows = p->fontheight ; rows-- ; dest_p += bytes) /* byte* add = natural */
   {
     cdat = *cdat_p++;
-    *((u_int*)dest_p) = (nibbletab_mach64[cdat >> 4] & eorx) ^ bgx;
-    ((u_int *)dest_p)[1] = (nibbletab_mach64[cdat & 0xF] & eorx) ^ bgx;
+    *((u32 *)dest_p) = (nibbletab_mach64[cdat >> 4] & eorx) ^ bgx;
+    ((u32 *)dest_p)[1] = (nibbletab_mach64[cdat & 0xF] & eorx) ^ bgx;
   }
   /*next row*/
 
@@ -426,8 +435,8 @@
     for(rows = p->fontheight, dest_p = dest0; rows-- ; dest_p += bytes)
     {
       cdat = *cdat_p++;
-      *((u_int*)dest_p) = (nibbletab_mach64[cdat >> 4] & eorx) ^ bgx;
-      ((u_int *)dest_p)[1] = (nibbletab_mach64[cdat & 0xF] & eorx) ^ bgx;
+      *((u32 *)dest_p) = (nibbletab_mach64[cdat >> 4] & eorx) ^ bgx;
+      ((u32 *)dest_p)[1] = (nibbletab_mach64[cdat & 0xF] & eorx) ^ bgx;
     }
     /*next rows*/
     dest0 += 8;
@@ -453,8 +462,8 @@
 
     dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
     for (rows = p->fontheight ; rows-- ; dest += bytes) {
-	((u_long *)dest)[0] ^= 0x0f0f0f0f;
-	((u_long *)dest)[1] ^= 0x0f0f0f0f;
+	((u32 *)dest)[0] ^= 0x0f0f0f0f;
+	((u32 *)dest)[1] ^= 0x0f0f0f0f;
     }
 }
 /*endproc rev_char_mach64() */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon-retz3.c m68k-2.1.72/drivers/video/fbcon-retz3.c
--- m68k-2.1.72-status/drivers/video/fbcon-retz3.c	Tue Nov 11 17:52:35 1997
+++ m68k-2.1.72/drivers/video/fbcon-retz3.c	Wed Jan  7 22:03:28 1998
@@ -50,7 +50,7 @@
 #define Z3BLTset		0xf0
 
 
-/*
+    /*
      *  `switch' for the low level operations
      */
 
@@ -60,10 +60,26 @@
 };
 
 
-/*
+    /*
      *  RetinaZ3 (accelerated)
      */
 
+static u32 nibbletab_cfb8[] = {
+#if defined(__BIG_ENDIAN)
+    0x00000000,0x000000ff,0x0000ff00,0x0000ffff,
+    0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff,
+    0xff000000,0xff0000ff,0xff00ff00,0xff00ffff,
+    0xffff0000,0xffff00ff,0xffffff00,0xffffffff
+#elif defined(__LITTLE_ENDIAN)
+    0x00000000,0xff000000,0x00ff0000,0xffff0000,
+    0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00,
+    0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff,
+    0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff
+#else
+#error FIXME: No endianness??
+#endif
+};
+
 static int open_retz3(struct display *p)
 {
 	if (p->type != FB_TYPE_PACKED_PIXELS ||
@@ -125,122 +141,68 @@
 		     col);
 }
 
-static void putc_retz3(struct vc_data *conp, struct display *p,
-		       int c, int ypos, int xpos)
+static void putc_retz3(struct vc_data *conp, struct display *p, int c, int yy,
+		       int xx)
 {
-	unsigned char *dest, *cdat;
-	unsigned long tmp;
-	unsigned int rows, revs, underl;
-	unsigned char d;
-	unsigned char fg, bg;
-
-	c &= 0xff;
-
-	dest = p->screen_base + ypos * p->fontheight * p->next_line +
-	        xpos*p->fontwidth;
+    u_char *dest,*cdat;
+    int bytes=p->next_line,rows;
+    u32 eorx,fgx,bgx;
+
+    c &= 0xff;
+
+    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
+    cdat = p->fontdata + c * p->fontheight;
+
+    fgx=attr_fgcol(p,conp);
+    bgx=attr_bgcol(p,conp);
+    fgx |= (fgx << 8);
+    fgx |= (fgx << 16);
+    bgx |= (bgx << 8);
+    bgx |= (bgx << 16);
+    eorx = fgx ^ bgx;
+
+    for (rows = p->fontheight ; rows-- ; dest += bytes) {
+	((u32 *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
+	((u32 *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx;
+    }
+}
+
+static void putcs_retz3(struct vc_data *conp, struct display *p, const char *s,
+			int count, int yy, int xx)
+{
+    u_char *cdat, c, *dest, *dest0;
+    int rows,bytes=p->next_line;
+    u32 eorx, fgx, bgx;
+
+    dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 8;
+    fgx=attr_fgcol(p,conp);
+    bgx=attr_bgcol(p,conp);
+    fgx |= (fgx << 8);
+    fgx |= (fgx << 16);
+    bgx |= (bgx << 8);
+    bgx |= (bgx << 16);
+    eorx = fgx ^ bgx;
+    while (count--) {
+	c = *s++;
 	cdat = p->fontdata + c * p->fontheight;
-
-	fg = p->fgcol;
-	bg = p->bgcol;
-	revs = conp->vc_reverse;
-	underl = conp->vc_underline;
-
-	for (rows = p->fontheight; rows--; dest += p->next_line) {
-		d = *cdat++;
-
-		if (underl && !rows)
-			d = 0xff;
-		if (revs)
-			d = ~d;
-
-		tmp =  ((d & 0x80) ? fg : bg) << 24;
-		tmp |= ((d & 0x40) ? fg : bg) << 16;
-		tmp |= ((d & 0x20) ? fg : bg) << 8;
-		tmp |= ((d & 0x10) ? fg : bg);
-		*((unsigned long*) dest) = tmp;
-		tmp =  ((d & 0x8) ? fg : bg) << 24;
-		tmp |= ((d & 0x4) ? fg : bg) << 16;
-		tmp |= ((d & 0x2) ? fg : bg) << 8;
-		tmp |= ((d & 0x1) ? fg : bg);
-		*((unsigned long*) dest + 1) = tmp;
-	}
-}
-
-static void putcs_retz3(struct vc_data *conp, struct display *p,
-			const char *s, int count, int ypos, int xpos)
-{
-	unsigned char *dest, *dest0, *cdat;
-	unsigned long tmp;
-	unsigned int rows, revs, underl;
-	unsigned char c, d;
-	unsigned char fg, bg;
-
-	dest0 = p->screen_base + ypos * p->fontheight * p->next_line
-		+ xpos * p->fontwidth;
-
-	fg = p->fgcol;
-	bg = p->bgcol;
-	revs = conp->vc_reverse;
-	underl = conp->vc_underline;
-
-	while (count--) {
-		c = *s++;
-		dest = dest0;
-		dest0 += 8;
-
-		cdat = p->fontdata + c * p->fontheight;
-		for (rows = p->fontheight; rows--; dest += p->next_line) {
-			d = *cdat++;
-
-			if (underl && !rows)
-				d = 0xff;
-			if (revs)
-				d = ~d;
-
-			tmp =  ((d & 0x80) ? fg : bg) << 24;
-			tmp |= ((d & 0x40) ? fg : bg) << 16;
-			tmp |= ((d & 0x20) ? fg : bg) << 8;
-			tmp |= ((d & 0x10) ? fg : bg);
-			*((unsigned long*) dest) = tmp;
-			tmp =  ((d & 0x8) ? fg : bg) << 24;
-			tmp |= ((d & 0x4) ? fg : bg) << 16;
-			tmp |= ((d & 0x2) ? fg : bg) << 8;
-			tmp |= ((d & 0x1) ? fg : bg);
-			*((unsigned long*) dest + 1) = tmp;
-		}
+	for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
+	    ((u32 *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
+	    ((u32 *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx;
 	}
+	dest0+=8;
+    }
 }
 
-static void rev_char_retz3(struct display *p, int xpos, int ypos)
+static void rev_char_retz3(struct display *p, int xx, int yy)
 {
-	unsigned char *dest;
-	int bytes=p->next_line, rows;
-	unsigned int bpp, mask;
-
-	bpp = p->var.bits_per_pixel;
-
-	switch (bpp){
-	case 8:
-		mask = 0x0f0f0f0f;
-		break;
-	case 16:
-		mask = 0xffffffff;
-		break;
-	case 24:
-		mask = 0xffffffff; /* ??? */
-		break;
-	default:
-		printk("illegal depth for rev_char_retz3(), bpp = %i\n", bpp);
-		return;
-	}
-
-	dest = p->screen_base + ypos * p->fontheight * bytes +
-		xpos * p->fontwidth;
+    u_char *dest;
+    int bytes=p->next_line, rows;
 
-	for (rows = p->fontheight ; rows-- ; dest += bytes) {
-		((unsigned long *)dest)[0] ^= mask;
-		((unsigned long *)dest)[1] ^= mask;
-	}
+    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
+    for (rows = p->fontheight ; rows-- ; dest += bytes) {
+        ((u32 *)dest)[0] ^= 0x0f0f0f0f;
+        ((u32 *)dest)[1] ^= 0x0f0f0f0f;
+    }
 }
 
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon-virge.c m68k-2.1.72/drivers/video/fbcon-virge.c
--- m68k-2.1.72-status/drivers/video/fbcon-virge.c	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/fbcon-virge.c	Wed Jan  7 22:03:28 1998
@@ -0,0 +1,225 @@
+/*
+ *  linux/drivers/video/fbcon-virge.c -- Low level frame buffer operations
+ *			     for the CyberVision64/3D (accelerated)
+ *
+ *	Created 28 Dec 1997 by Andre Heynatz
+ *
+ *      based on fbcon-cyber.c (same dir) and fbcon.c from Linux 2.0.31pre3
+ *      (both written by Geert Uytterhoeven and others)
+ *
+ *  This file is subject to the terms and conditions of the GNU General Public
+ *  License.  See the file COPYING in the main directory of this archive for
+ *  more details.
+ */
+
+#define FBCONVIRGEDEBUG
+
+#include <linux/module.h>
+#include <linux/tty.h>
+#include <linux/console.h>
+#include <linux/string.h>
+#include <linux/config.h>
+#include <linux/fb.h>
+
+#include "fbcon.h"
+#include "s3blit.h"
+
+#ifdef FBCONVIRGEDEBUG
+#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
+#else
+#define DPRINTK(fmt, args...)
+#endif
+
+    /*
+     *  Prototypes
+     */
+
+static int open_cyber3d(struct display *p);
+static void release_cyber3d(void);
+static void bmove_cyber3d(struct display *p, int sy, int sx, int dy, int dx,
+	                int height, int width);
+static void clear_cyber3d(struct vc_data *conp, struct display *p, int sy, int sx,
+	                int height, int width);
+/* TODO:
+static void putc_cyber3d(struct vc_data *conp, struct display *p, int c, int yy,
+	               int xx);
+static void putcs_cyber3d(struct vc_data *conp, struct display *p, const char *s,
+	                int count, int yy, int xx);
+static void rev_char_cyber3d(struct display *p, int xx, int yy);
+*/
+/* prototypes for cfb8 functions, can be done without replicating code,
+   remove them if they are replaced by native functions */
+
+static void putc_cfb8(struct vc_data *conp, struct display *p, int c, int yy,
+                       int xx);
+static void putcs_cfb8(struct vc_data *conp, struct display *p, const char *s,
+                        int count, int yy, int xx);
+static void rev_char_cfb8(struct display *p, int xx, int yy);
+
+    /*
+     *  Acceleration functions in cyberfb.c
+     */
+
+extern void Cyber3D_WaitQueue(unsigned short fifo);
+extern void Cyber_WaitBlit(void);
+extern void Cyber3D_BitBLT(unsigned short curx, unsigned short cury,
+			 unsigned short destx, unsigned short desty,
+			 unsigned short width, unsigned short height,
+			 unsigned short mode);
+extern void Cyber3D_RectFill(unsigned short xx, unsigned short yy,
+			   unsigned short width, unsigned short height,
+			     /* unsigned short mode, */ unsigned short fillcolor);
+extern void Cyber_MoveCursor(unsigned short xx, unsigned short yy);
+
+
+    /*
+     *  `switch' for the low level operations
+     */
+
+static struct display_switch dispsw_cyber3d = {
+   open_cyber3d, release_cyber3d, bmove_cyber3d, clear_cyber3d, putc_cfb8,
+   putcs_cfb8, rev_char_cfb8
+};
+
+    /*
+     *  CyberVision64/3D (accelerated)
+     */
+
+static int open_cyber3d(struct display *p)
+{
+    if (p->type != FB_TYPE_PACKED_PIXELS ||
+        p->var.accel != FB_ACCEL_CYBERVISION3D) {
+        DPRINTK("accelerated driver not wanted\n");
+        return -EINVAL;
+    }
+    p->next_line = p->var.xres_virtual*p->var.bits_per_pixel>>3;
+    p->next_plane = 0;
+    MOD_INC_USE_COUNT;
+    return 0;
+}
+
+static void release_cyber3d(void)
+{
+    MOD_DEC_USE_COUNT;
+}
+
+static void bmove_cyber3d(struct display *p, int sy, int sx, int dy, int dx,
+	                int height, int width)
+{
+        sx *= 8; dx *= 8; width *= 8;
+        Cyber3D_BitBLT((u_short)sx, (u_short)(sy*p->fontheight), (u_short)dx,
+                       (u_short)(dy*p->fontheight), (u_short)width,
+                       (u_short)(height*p->fontheight), (u_short)S3_NEW);
+}
+
+static void clear_cyber3d(struct vc_data *conp, struct display *p,
+                          int sy, int sx, int height, int width)
+{
+        unsigned char bg;
+
+        sx *= 8; width *= 8;
+        bg = attr_bgcol_ec(p,conp);
+        Cyber3D_RectFill((u_short)sx, (u_short)(sy*p->fontheight),
+                         (u_short)width, (u_short)(height*p->fontheight),
+                         (u_short)bg);
+}
+
+/* the following structures are copies from fbcon-cfb8.c
+   remove them if there are no functions from fbcon-cfb8 left */
+
+static u_long nibbletab_cfb8[] = {
+    0x00000000,0x000000ff,0x0000ff00,0x0000ffff,
+    0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff,
+    0xff000000,0xff0000ff,0xff00ff00,0xff00ffff,
+    0xffff0000,0xffff00ff,0xffffff00,0xffffffff
+};
+
+/* the following functions are copies from fbcon-cfb8.c
+   TODO: rewrite them for the Cybervision64/3D
+*/
+
+static void putc_cfb8(struct vc_data *conp, struct display *p, int c, int yy,
+                      int xx)
+{
+    u_char *dest,*cdat;
+    int bytes=p->next_line,rows;
+    ulong eorx,fgx,bgx;
+
+    c &= 0xff;
+
+    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
+    cdat = p->fontdata + c * p->fontheight;
+
+    fgx=attr_fgcol(p,conp);
+    bgx=attr_bgcol(p,conp);
+    fgx |= (fgx << 8);
+    fgx |= (fgx << 16);
+    bgx |= (bgx << 8);
+    bgx |= (bgx << 16);
+    eorx = fgx ^ bgx;
+
+    for (rows = p->fontheight ; rows-- ; dest += bytes) {
+        ((u_long *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
+        ((u_long *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx;
+    }
+}
+
+static void putcs_cfb8(struct vc_data *conp, struct display *p, const char *s,
+                       int count, int yy, int xx)
+{
+    u_char *cdat, c, *dest, *dest0;
+    int rows,bytes=p->next_line;
+    u_long eorx, fgx, bgx;
+
+    dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 8;
+    fgx=attr_fgcol(p,conp);
+    bgx=attr_bgcol(p,conp);
+    fgx |= (fgx << 8);
+    fgx |= (fgx << 16);
+    bgx |= (bgx << 8);
+    bgx |= (bgx << 16);
+    eorx = fgx ^ bgx;
+    while (count--) {
+        c = *s++;
+        cdat = p->fontdata + c * p->fontheight;
+
+        for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
+            ((u_long *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
+            ((u_long *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^
+                                 bgx;
+        }
+        dest0+=8;
+    }
+}
+
+static void rev_char_cfb8(struct display *p, int xx, int yy)
+{
+    u_char *dest;
+    int bytes=p->next_line, rows;
+
+    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
+    for (rows = p->fontheight ; rows-- ; dest += bytes) {
+        ((u_long *)dest)[0] ^= 0x0f0f0f0f;
+        ((u_long *)dest)[1] ^= 0x0f0f0f0f;
+    }
+}
+
+
+#ifdef MODULE
+int init_module(void)
+#else
+int fbcon_init_cyber3d(void)
+#endif
+{
+     DPRINTK("registering accelerated driver\n");
+     return(fbcon_register_driver(&dispsw_cyber3d, 1));
+}
+
+#ifdef MODULE
+void cleanup_module(void)
+{
+    fbcon_unregister_driver(&dispsw_cyber3d);
+}
+#endif /* MODULE */
+
+
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbcon.c m68k-2.1.72/drivers/video/fbcon.c
--- m68k-2.1.72-status/drivers/video/fbcon.c	Wed Dec 17 23:55:40 1997
+++ m68k-2.1.72/drivers/video/fbcon.c	Wed Jan  7 22:18:51 1998
@@ -41,8 +41,10 @@
  *    - accelerated:
  *
  *	  o cyber	 CyberVision64 packed pixels (accelerated)
+ *        o virge        CyberVision64/3D packed pixels (accelerated)
  *	  o retz3	 Retina Z3 packed pixels (accelerated)
  *	  o mach64	 ATI Mach 64 packed pixels (accelerated)
+ *	  o aty		 ATI Mach 64 packed pixels (accelerated)
  *
  *  To do:
  *
@@ -56,6 +58,8 @@
  *  more details.
  */
 
+#define FBCONDEBUG
+
 #define SUPPORT_SCROLLBACK	0
 #define FLASHING_CURSOR		1
 
@@ -65,6 +69,7 @@
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/kernel.h>
+#include <linux/delay.h>	/* MSch: for IRQ probe */
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
@@ -88,6 +93,9 @@
 #ifdef CONFIG_ATARI
 #include <asm/atariints.h>
 #endif
+#ifdef CONFIG_MAC
+#include <asm/macints.h>
+#endif
 #ifdef __mc68000__
 #include <asm/machdep.h>
 #include <asm/setup.h>
@@ -97,6 +105,11 @@
 #include "fbcon.h"
 #include "font.h"
 
+#ifdef FBCONDEBUG
+#  define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
+#else
+#  define DPRINTK(fmt, args...)
+#endif
 
 struct display fb_display[MAX_NR_CONSOLES];
 
@@ -112,6 +125,7 @@
 /* # VBL ints between cursor state changes */
 #define AMIGA_CURSOR_BLINK_RATE		(20)
 #define ATARI_CURSOR_BLINK_RATE		(42)
+#define MAC_CURSOR_BLINK_RATE		(32)
 #define DEFAULT_CURSOR_BLINK_RATE	(20)
 
 static int vbl_cursor_cnt = 0;
@@ -203,6 +217,19 @@
 static int fbcon_show_logo(void);
 
 #if FLASHING_CURSOR
+
+#ifdef CONFIG_MAC
+/*
+ * On the Macintoy, there may or may not be a working VBL int. We need to prob
+ */
+static int vbl_detected = 0;
+
+static void fbcon_vbl_detect(int irq, void *dummy, struct pt_regs *fp)
+{
+      vbl_detected++;
+}
+#endif
+
 static void cursor_timer_handler(unsigned long dev_addr);
 
 static struct timer_list cursor_timer = {
@@ -212,7 +239,7 @@
 static void cursor_timer_handler(unsigned long dev_addr)
 {
       fbcon_vbl_handler(0, NULL, NULL);
-      cursor_timer.expires = jiffies+2;
+      cursor_timer.expires = jiffies+HZ/50;
       cursor_timer.data = 0;
       cursor_timer.next = cursor_timer.next = NULL;
       add_timer(&cursor_timer);
@@ -243,6 +270,12 @@
 #ifdef CONFIG_FBCON_IPLAN2P8
 extern int fbcon_init_iplan2p8(void);
 #endif
+#ifdef CONFIG_FBCON_CFB2
+extern int fbcon_init_cfb2(void);
+#endif
+#ifdef CONFIG_FBCON_CFB4
+extern int fbcon_init_cfb4(void);
+#endif
 #ifdef CONFIG_FBCON_CFB8
 extern int fbcon_init_cfb8(void);
 #endif
@@ -258,12 +291,27 @@
 #ifdef CONFIG_FBCON_CYBER
 extern int fbcon_init_cyber(void);
 #endif
+#ifdef CONFIG_FBCON_VIRGE
+extern int fbcon_init_cyber3d(void);
+#endif
+#ifdef CONFIG_FBCON_VIRGE
+extern int fbcon_init_cyber3d(void);
+#endif
 #ifdef CONFIG_FBCON_RETINAZ3
 extern int fbcon_init_retz3(void);
 #endif
 #ifdef CONFIG_FBCON_MACH64
 extern int fbcon_init_mach64(void);
 #endif
+#ifdef CONFIG_FBCON_TRIO
+extern int fbcon_init_trio(void);
+#endif
+#ifdef CONFIG_FBCON_ATY
+extern int fbcon_init_aty(void);
+#endif
+#ifdef CONFIG_FBCON_MAC
+extern int fbcon_init_mac(void);
+#endif
 
 __initfunc(static unsigned long fbcon_startup(unsigned long kmem_start,
 					      const char **display_desc))
@@ -273,9 +321,10 @@
     /* Probe all frame buffer devices */
     kmem_start = probe_framebuffers(kmem_start);
 
-    if (!num_registered_fb)
+    if (!num_registered_fb) {
+            DPRINTK("no framebuffer registered\n");
 	    return kmem_start;
-
+    }
     /* Initialize all built-in low level drivers */
 #ifdef CONFIG_FBCON_RETINAZ3
     fbcon_init_retz3();
@@ -298,6 +347,12 @@
 #ifdef CONFIG_FBCON_AFB
     fbcon_init_afb();
 #endif
+#ifdef CONFIG_FBCON_CFB2
+    fbcon_init_cfb2();
+#endif
+#ifdef CONFIG_FBCON_CFB4
+    fbcon_init_cfb4();
+#endif
 #ifdef CONFIG_FBCON_CFB8
     fbcon_init_cfb8();
 #endif
@@ -313,9 +368,24 @@
 #ifdef CONFIG_FBCON_CYBER
     fbcon_init_cyber();
 #endif
+#ifdef CONFIG_FBCON_VIRGE
+    fbcon_init_cyber3d();
+#endif
+#ifdef CONFIG_FBCON_VIRGE
+    fbcon_init_cyber3d();
+#endif
 #ifdef CONFIG_FBCON_MACH64
     fbcon_init_mach64();
 #endif
+#ifdef CONFIG_FBCON_TRIO
+    fbcon_init_trio();
+#endif
+#ifdef CONFIG_FBCON_ATY
+    fbcon_init_aty();
+#endif
+#ifdef CONFIG_FBCON_MAC
+    fbcon_init_mac();
+#endif
 
     *display_desc = "frame buffer device";
 
@@ -333,9 +403,49 @@
 			     "console/cursor", fbcon_vbl_handler);
     }
 #endif /* CONFIG_ATARI */
+
+#ifdef CONFIG_MAC
+    /*
+     * On a Macintoy, the VBL interrupt may or may not be active. 
+     * As interrupt based cursor is more reliable and race free, we 
+     * probe for VBL interrupts.
+     */
+    if (MACH_IS_MAC) {
+       int ct = 0;
+       /*
+        * Probe for VBL: set temp. handler ...
+        */
+       irqres = request_irq(IRQ_MAC_VBL, fbcon_vbl_detect, 0,
+                            "console/cursor", fbcon_vbl_detect);
+       /*
+        * ... and spin for 20 ms ...
+        */
+       while (!vbl_detected && ++ct<1000)
+          udelay(20);
+ 
+       if(ct==1000)
+          printk("fbcon_startup: No VBL detected, using timer based cursor.\n");
+ 
+       if (vbl_detected) {
+         /*
+          * interrupt based cursor ok
+          */
+          cursor_blink_rate = MAC_CURSOR_BLINK_RATE;
+          irqres = request_irq(IRQ_MAC_VBL, fbcon_vbl_handler, 0,
+                               "console/cursor", fbcon_vbl_handler);
+       } else {
+          /*
+           * VBL not detected: fall through, use timer based cursor
+           */
+           irqres = 1;
+	   /* free interrupt here ?? */
+       }
+    }
+#endif /* CONFIG_MAC */
+
     if (irqres) {
 	cursor_blink_rate = DEFAULT_CURSOR_BLINK_RATE;
-	cursor_timer.expires = jiffies+2;
+	cursor_timer.expires = jiffies+HZ/50;
 	cursor_timer.data = 0;
 	cursor_timer.next = cursor_timer.prev = NULL;
 	add_timer(&cursor_timer);
@@ -358,6 +468,11 @@
 
     info->changevar = &fbcon_changevar;
     fb_display[unit] = *(info->disp);	/* copy from default */
+    DPRINTK("mode:   %s\n",info->modename);
+    DPRINTK("visual: %d\n",fb_display[unit].visual);
+    DPRINTK("res:    %dx%d-%d\n",fb_display[unit].var.xres,
+	                     fb_display[unit].var.yres,
+	                     fb_display[unit].var.bits_per_pixel);
     fb_display[unit].conp = conp;
     fb_display[unit].fb_info = info;
     fbcon_setup(unit, 1, 1);
@@ -412,7 +527,7 @@
 		      &p->fontdata) || p->fontwidth != 8)
 	getdefaultfont(p->var.xres, p->var.yres, NULL, &p->fontwidth,
 		       &p->fontheight, &p->fontdata);
-    if (p->fontwidth != 8) {
+    if (p->fontwidth != 8 && !MACH_IS_MAC) {
 	/* ++Geert: changed from panic() to `correct and continue' */
 	printk(KERN_ERR "fbcon_setup: No support for fontwidth != 8");
 	p->fontwidth = 8;
@@ -621,7 +736,7 @@
     p->var.xoffset = 0;
     p->var.yoffset = p->yscroll*p->fontheight;
     p->var.vmode |= FB_VMODE_YWRAP;
-    p->fb_info->updatevar(unit);
+    p->fb_info->updatevar(unit, p->fb_info);
 #if SUPPORT_SCROLLBACK
     scrollback_max += count;
     if (scrollback_max > p->vrows-conp->vc_rows)
@@ -644,7 +759,7 @@
     p->var.xoffset = 0;
     p->var.yoffset = p->yscroll*p->fontheight;
     p->var.vmode |= FB_VMODE_YWRAP;
-    p->fb_info->updatevar(unit);
+    p->fb_info->updatevar(unit, p->fb_info);
 #if SUPPORT_SCROLLBACK
     scrollback_max -= count;
     if (scrollback_max < 0)
@@ -666,7 +781,7 @@
     p->var.xoffset = 0;
     p->var.yoffset = p->yscroll*p->fontheight;
     p->var.vmode &= ~FB_VMODE_YWRAP;
-    p->fb_info->updatevar(unit);
+    p->fb_info->updatevar(unit, p->fb_info);
 }
 
 
@@ -682,7 +797,7 @@
     p->var.xoffset = 0;
     p->var.yoffset = p->yscroll*p->fontheight;
     p->var.vmode &= ~FB_VMODE_YWRAP;
-    p->fb_info->updatevar(unit);
+    p->fb_info->updatevar(unit, p->fb_info);
 }
 
 
@@ -892,7 +1007,7 @@
     struct fb_info *info = p->fb_info;
 
     if (info && info->switch_con)
-	(*info->switch_con)(conp->vc_num);
+	(*info->switch_con)(conp->vc_num, info);
 #if SUPPORT_SCROLLBACK
     scrollback_max = 0;
     scrollback_current = 0;
@@ -904,6 +1019,7 @@
 static int fbcon_blank(int blank)
 {
     struct display *p = &fb_display[fg_console];
+    struct fb_info *info = p->fb_info;
 
     fbcon_cursor(p->conp, blank ? CM_ERASE : CM_DRAW);
 
@@ -923,7 +1039,7 @@
 	    return(1);
 	}
     }
-    (*p->fb_info->blank)(blank);
+    (*info->blank)(blank, info);
     return(0);
 }
 
@@ -1076,8 +1192,7 @@
     palette_cmap.len = 1<<p->var.bits_per_pixel;
     if (palette_cmap.len > 16)
 	palette_cmap.len = 16;
-    return(p->fb_info->fbops->fb_set_cmap(&palette_cmap, 1, unit,
-					  con2fb_map[unit]));
+    return p->fb_info->fbops->fb_set_cmap(&palette_cmap, 1, unit, p->fb_info);
 }
 
 static int fbcon_scrolldelta(int lines)
@@ -1108,7 +1223,7 @@
     p->var.vmode |= FB_VMODE_YWRAP;
     p->var.xoffset = 0;
     p->var.yoffset = offset*p->fontheight;
-    p->fb_info->updatevar(unit);
+    p->fb_info->updatevar(unit, p->fb_info);
 #else
     return -ENOSYS;
 #endif
@@ -1166,7 +1281,7 @@
 		palette_cmap.blue[j]  = (blue[i+j] << 8) | blue[i+j];
 	    }
 	    p->fb_info->fbops->fb_set_cmap(&palette_cmap, 1, fg_console,
-					   con2fb_map[fg_console]);
+					   p->fb_info);
 	}
 	fb_display[fg_console].cmap.len = old_cmap_len;
     }
@@ -1184,12 +1299,13 @@
 	logo_depth = 1;
     }
 
-#if defined(CONFIG_FBCON_CFB16) || defined(CONFIG_FBCON_CYBER) || \
-    defined(CONFIG_FBCON_RETINAZ3)
+#if defined(CONFIG_FBCON_CFB16) || defined(CONFIG_FBCON_CFB24) || \
+    defined(CONFIG_FBCON_CFB32) || defined(CONFIG_FBCON_CYBER) || \
+    defined(CONFIG_FBCON_VIRGE) || defined(CONFIG_FBCON_RETINAZ3)
     if ((depth % 8 == 0) && (p->visual == FB_VISUAL_TRUECOLOR ||
 			     p->visual == FB_VISUAL_DIRECTCOLOR)) {
 	/* Modes without color mapping, needs special data transformation... */
-	unsigned long val;		/* max. depth 32! */
+	unsigned int val;		/* max. depth 32! */
 	int bdepth = depth/8;
 	unsigned char mask[9] = { 0,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff };
 	unsigned char redmask, greenmask, bluemask;
@@ -1219,7 +1335,8 @@
     }
 #endif
 #if defined(CONFIG_FBCON_CFB8) || defined(CONFIG_FBCON_CYBER) || \
-    defined(CONFIG_FBCON_RETINAZ3)
+    defined(CONFIG_FBCON_VIRGE) || defined(CONFIG_FBCON_RETINAZ3)
+
     if (depth == 8 && p->type == FB_TYPE_PACKED_PIXELS) {
 	/* depth 8 or more, packed, with color registers */
 		
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fbgen.c m68k-2.1.72/drivers/video/fbgen.c
--- m68k-2.1.72-status/drivers/video/fbgen.c	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/fbgen.c	Wed Jan  7 22:03:28 1998
@@ -0,0 +1,384 @@
+/*
+ * linux/drivers/video/fbgen.c -- Generic routines for frame buffer devices
+ *
+ *  Created 3 Jan 1998 by Geert Uytterhoeven
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file README.legal in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/module.h>
+#include <linux/string.h>
+#include <linux/tty.h>
+#include <linux/fb.h>
+#include <linux/slab.h>
+
+#include <asm/uaccess.h>
+
+
+
+static int currcon = 0;
+
+static struct display disp;
+
+
+    /*
+     *  `Generic' versions of the frame buffer device operations
+     */
+
+extern int fbgen_get_fix(struct fb_fix_screeninfo *fix, int con,
+			 struct fb_info *info);
+extern int fbgen_get_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info);
+extern int fbgen_set_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info);
+extern int fbgen_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info);
+extern int fbgen_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info);
+extern int fbgen_pan_display(struct fb_var_screeninfo *var, int con,
+			     struct fb_info *info);
+extern int fbgen_ioctl(struct inode *inode, struct file *file,
+		       unsigned int cmd, unsigned long arg, int con,
+		       struct fb_info *info);
+
+
+    /*
+     *  Helper functions
+     */
+
+int fbgen_do_set_var(struct fb_var_screeninfo *var, int isactive,
+		     struct fb_info_gen *info);
+void fbgen_set_disp(int con, struct fb_info_gen *info);
+void fbgen_install_cmap(int con, struct fb_info_gen *info);
+int fbgen_update_var(int con, struct fb_info *info);
+int fbgen_switch(int con, struct fb_info *info);
+void fbgen_blank(int blank, struct fb_info *info);
+
+
+/* ---- `Generic' versions of the frame buffer device operations ----------- */
+
+
+    /*
+     *  Get the Fixed Part of the Display
+     */
+
+int fbgen_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info)
+{
+    struct fb_info_gen *info2 = (struct fb_info_gen *)info;
+    struct fbgen_hwswitch *fbhw = info2->fbhw;
+    char par[info2->parsize];
+
+    if (con == -1)
+	fbhw->get_par(&par, info2);
+    else {
+	int err;
+
+	if ((err = fbhw->decode_var(&fb_display[con].var, &par, info2)))
+	    return err;
+    }
+    memset(fix, 0, sizeof(struct fb_fix_screeninfo));
+    return fbhw->encode_fix(fix, &par, info2);
+}
+
+
+    /*
+     *  Get the User Defined Part of the Display
+     */
+
+int fbgen_get_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
+{
+    struct fb_info_gen *info2 = (struct fb_info_gen *)info;
+    struct fbgen_hwswitch *fbhw = info2->fbhw;
+    char par[info2->parsize];
+
+    if (con == -1) {
+	fbhw->get_par(&par, info2);
+	fbhw->encode_var(var, &par, info2);
+    } else
+	*var = fb_display[con].var;
+    return 0;
+}
+
+
+    /*
+     *  Set the User Defined Part of the Display
+     */
+
+int fbgen_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
+{
+    struct fb_info_gen *info2 = (struct fb_info_gen *)info;
+    int err;
+    int oldxres, oldyres, oldbpp, oldxres_virtual, oldyres_virtual, oldyoffset;
+
+    if ((err = fbgen_do_set_var(var, con == currcon, info2)))
+	return err;
+    if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
+	oldxres = fb_display[con].var.xres;
+	oldyres = fb_display[con].var.yres;
+	oldxres_virtual = fb_display[con].var.xres_virtual;
+	oldyres_virtual = fb_display[con].var.yres_virtual;
+	oldbpp = fb_display[con].var.bits_per_pixel;
+	oldyoffset = fb_display[con].var.yoffset;
+	fb_display[con].var = *var;
+	if (oldxres != var->xres || oldyres != var->yres ||
+	    oldxres_virtual != var->xres_virtual ||
+	    oldyres_virtual != var->yres_virtual ||
+	    oldbpp != var->bits_per_pixel ||
+	    oldyoffset != var->yoffset) {
+	    fbgen_set_disp(con, info2);
+	    if (info->changevar)
+		(*info->changevar)(con);
+	    if ((err = fb_alloc_cmap(&fb_display[con].cmap, 0, 0)))
+		return err;
+	    fbgen_install_cmap(con, info2);
+	}
+    }
+    var->activate = 0;
+    return 0;
+}
+
+
+    /*
+     *  Get the Colormap
+     */
+
+int fbgen_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+		   struct fb_info *info)
+{
+    struct fb_info_gen *info2 = (struct fb_info_gen *)info;
+    struct fbgen_hwswitch *fbhw = info2->fbhw;
+
+    if (con == currcon)			/* current console ? */
+	return fb_get_cmap(cmap, &fb_display[con].var, kspc, fbhw->getcolreg,
+			   info);
+    else
+	if (fb_display[con].cmap.len)	/* non default colormap ? */
+	    fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
+	else
+	    fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
+			 cmap, kspc ? 0 : 2);
+    return 0;
+}
+
+
+    /*
+     *  Set the Colormap
+     */
+
+int fbgen_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+		   struct fb_info *info)
+{
+    struct fb_info_gen *info2 = (struct fb_info_gen *)info;
+    struct fbgen_hwswitch *fbhw = info2->fbhw;
+    int err;
+
+    if (!fb_display[con].cmap.len) {	/* no colormap allocated ? */
+	if ((err = fb_alloc_cmap(&fb_display[con].cmap,
+				 1 << fb_display[con].var.bits_per_pixel, 0)))
+	    return err;
+    }
+    if (con == currcon)			/* current console ? */
+	return fb_set_cmap(cmap, &fb_display[con].var, kspc, fbhw->setcolreg,
+			   info);
+    else
+	fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
+    return 0;
+}
+
+
+    /*
+     *  Pan or Wrap the Display
+     *
+     *  This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
+     */
+
+int fbgen_pan_display(struct fb_var_screeninfo *var, int con,
+		      struct fb_info *info)
+{
+    struct fb_info_gen *info2 = (struct fb_info_gen *)info;
+    struct fbgen_hwswitch *fbhw = info2->fbhw;
+    int xoffset = var->xoffset;
+    int yoffset = var->yoffset;
+    int err;
+
+    if (xoffset < 0 ||
+	xoffset+fb_display[con].var.xres > fb_display[con].var.xres_virtual ||
+	yoffset < 0 ||
+	yoffset+fb_display[con].var.yres > fb_display[con].var.yres_virtual)
+	return -EINVAL;
+    if (con == currcon) {
+	if (fbhw->pan_display) {
+	    if ((err = fbhw->pan_display(var, info2)))
+		return err;
+	} else
+	    return -EINVAL;
+    }
+    fb_display[con].var.xoffset = var->xoffset;
+    fb_display[con].var.yoffset = var->yoffset;
+    if (var->vmode & FB_VMODE_YWRAP)
+	fb_display[con].var.vmode |= FB_VMODE_YWRAP;
+    else
+	fb_display[con].var.vmode &= ~FB_VMODE_YWRAP;
+
+    return 0;
+}
+
+
+    /*
+     *  Frame Buffer Specific ioctls
+     */
+
+int fbgen_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+		unsigned long arg, int con, struct fb_info *info)
+{
+    return -EINVAL;
+}
+
+
+/* ---- Helper functions --------------------------------------------------- */
+
+
+    /*
+     *  Change the video mode
+     */
+
+int fbgen_do_set_var(struct fb_var_screeninfo *var, int isactive,
+		     struct fb_info_gen *info)
+{
+    struct fbgen_hwswitch *fbhw = info->fbhw;
+    int err, activate;
+    char par[info->parsize];
+
+    if ((err = fbhw->decode_var(var, &par, info)))
+	return err;
+    activate = var->activate;
+    if (((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) && isactive)
+	fbhw->set_par(&par, info);
+    fbhw->encode_var(var, &par, info);
+    var->activate = activate;
+    return 0;
+}
+
+
+    /*
+     *  Set the display parameters for a video mode
+     */
+
+void fbgen_set_disp(int con, struct fb_info_gen *info)
+{
+    struct fb_fix_screeninfo fix;
+    struct display *display;
+
+    if (con >= 0)
+	display = &fb_display[con];
+    else
+	display = &disp;	/* used during initialization */
+
+    fbgen_get_fix(&fix, con, &info->info);
+    if (con == -1)
+	con = 0;
+
+    display->screen_base = fix.smem_start;
+    display->visual = fix.visual;
+    display->type = fix.type;
+    display->type_aux = fix.type_aux;
+    display->ypanstep = fix.ypanstep;
+    display->ywrapstep = fix.ywrapstep;
+    display->line_length = fix.line_length;
+    if (info->fbhw->blank || fix.visual == FB_VISUAL_PSEUDOCOLOR ||
+	fix.visual == FB_VISUAL_DIRECTCOLOR)
+	display->can_soft_blank = 1;
+    else
+	display->can_soft_blank = 0;
+#if 0 /* FIXME: generic inverse is not supported yet */
+    display->inverse = (fix.visual == FB_VISUAL_MONO01 ? !inverse : inverse);
+#else
+    display->inverse = fix.visual == FB_VISUAL_MONO01;
+#endif
+}
+
+
+    /*
+     *  Install the current colormap
+     */
+
+void fbgen_install_cmap(int con, struct fb_info_gen *info)
+{
+    struct fbgen_hwswitch *fbhw = info->fbhw;
+    if (con != currcon)
+	return;
+    if (fb_display[con].cmap.len)
+	fb_set_cmap(&fb_display[con].cmap, &fb_display[con].var, 1,
+		    fbhw->setcolreg, &info->info);
+    else
+	fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
+		    &fb_display[con].var, 1, fbhw->setcolreg, &info->info);
+}
+
+
+    /*
+     *  Update the `var' structure (called by fbcon.c)
+     */
+
+int fbgen_update_var(int con, struct fb_info *info)
+{
+    struct fb_info_gen *info2 = (struct fb_info_gen *)info;
+    struct fbgen_hwswitch *fbhw = info2->fbhw;
+    int err;
+
+    if (fbhw->pan_display) {
+        if ((err = fbhw->pan_display(&fb_display[con].var, info2)))
+            return err;
+    }
+    return 0;
+}
+
+
+    /*
+     *  Switch to a different virtual console
+     */
+
+int fbgen_switch(int con, struct fb_info *info)
+{
+    struct fb_info_gen *info2 = (struct fb_info_gen *)info;
+    struct fbgen_hwswitch *fbhw = info2->fbhw;
+
+    /* Do we have to save the colormap ? */
+    if (fb_display[currcon].cmap.len)
+	fb_get_cmap(&fb_display[currcon].cmap, &fb_display[currcon].var, 1,
+		    fbhw->getcolreg, &info2->info);
+    fbgen_do_set_var(&fb_display[con].var, 1, info2);
+    currcon = con;
+    /* Install new colormap */
+    fbgen_install_cmap(con, info2);
+    return 0;
+}
+
+
+    /*
+     *  Blank the screen
+     */
+
+void fbgen_blank(int blank, struct fb_info *info)
+{
+    struct fb_info_gen *info2 = (struct fb_info_gen *)info;
+    struct fbgen_hwswitch *fbhw = info2->fbhw;
+    u16 black[16];
+    struct fb_cmap cmap;
+
+    if (fbhw->blank && !fbhw->blank(blank, info2))
+	return;
+    if (blank) {
+	memset(black, 0, 16*sizeof(u16));
+	cmap.red = black;
+	cmap.green = black;
+	cmap.blue = black;
+	cmap.transp = NULL;
+	cmap.start = 0;
+	cmap.len = 16;
+	fb_set_cmap(&cmap, &fb_display[currcon].var, 1, fbhw->setcolreg, info);
+    } else
+	fbgen_install_cmap(currcon, info2);
+}
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/font_6x11.c m68k-2.1.72/drivers/video/font_6x11.c
--- m68k-2.1.72-status/drivers/video/font_6x11.c	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/font_6x11.c	Wed Jan  7 22:03:28 1998
@@ -0,0 +1,3345 @@
+/**********************************************/
+/*                                            */
+/*       Font file generated by rthelen       */
+/*                                            */
+/**********************************************/
+
+#define FONTDATAMAX (11*256)
+
+char fontname_6x11[] = "ProFont6x11";
+
+int  fontheight_6x11 = 11;
+int  fontwidth_6x11  = 6;
+
+unsigned char fontdata_6x11[FONTDATAMAX] = {
+
+	/* 0 0x00 '^A' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 1 0x01 '^B' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 2 0x02 '^C' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 3 0x03 '^D' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 4 0x04 '^E' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 5 0x05 '^F' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 6 0x06 '^G' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 7 0x07 '^H' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 8 0x08 '^I' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 9 0x09 '^J' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 10 0x0a '^K' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 11 0x0b '^L' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 12 0x0c '^M' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 13 0x0d '^N' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 14 0x0e '^O' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 15 0x0f '^P' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 16 0x10 '^Q' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 17 0x11 '^R' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x28, /* 00 0 000 */
+	0x54, /* 0 0 0 00 */
+	0x38, /* 00   000 */
+	0x54, /* 0 0 0 00 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 18 0x12 '^S' */
+	0x04, /* 00000 00 */
+	0x04, /* 00000 00 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x50, /* 0 0 0000 */
+	0x50, /* 0 0 0000 */
+	0x20, /* 00 00000 */
+	0x20, /* 00 00000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 19 0x13 '^T' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x38, /* 00   000 */
+	0x7c, /* 0     00 */
+	0x38, /* 00   000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 20 0x14 '^U' */
+	0x18, /* 000  000 */
+	0x10, /* 000 0000 */
+	0x28, /* 00 0 000 */
+	0x7c, /* 0     00 */
+	0x78, /* 0    000 */
+	0x78, /* 0    000 */
+	0x7c, /* 0     00 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 21 0x15 '^V' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 22 0x16 '^W' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 23 0x17 '^X' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 24 0x18 '^Y' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 25 0x19 '^Z' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 26 0x1a '^[' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 27 0x1b '^\' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 28 0x1c '^]' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 29 0x1d '^^' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 30 0x1e '^_' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 31 0x1f '^`' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 32 0x20 ' ' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 33 0x21 '!' */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 34 0x22 '"' */
+	0x28, /* 00 0 000 */
+	0x28, /* 00 0 000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 35 0x23 '#' */
+	0x00, /* 00000000 */
+	0x28, /* 00 0 000 */
+	0x7c, /* 0     00 */
+	0x28, /* 00 0 000 */
+	0x7c, /* 0     00 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 36 0x24 '$' */
+	0x10, /* 000 0000 */
+	0x38, /* 00   000 */
+	0x54, /* 0 0 0 00 */
+	0x50, /* 0 0 0000 */
+	0x38, /* 00   000 */
+	0x14, /* 000 0 00 */
+	0x54, /* 0 0 0 00 */
+	0x38, /* 00   000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 37 0x25 '%' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x54, /* 0 0 0 00 */
+	0x58, /* 0 0  000 */
+	0x28, /* 00 0 000 */
+	0x34, /* 00  0 00 */
+	0x54, /* 0 0 0 00 */
+	0x48, /* 0 00 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 38 0x26 '&' */
+	0x00, /* 00000000 */
+	0x30, /* 00  0000 */
+	0x48, /* 0 00 000 */
+	0x50, /* 0 0 0000 */
+	0x20, /* 00 00000 */
+	0x54, /* 0 0 0 00 */
+	0x48, /* 0 00 000 */
+	0x34, /* 00  0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 39 0x27 ''' */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 40 0x28 '(' */
+	0x04, /* 00000 00 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x08, /* 0000 000 */
+	0x04, /* 00000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 41 0x29 ')' */
+	0x20, /* 00 00000 */
+	0x10, /* 000 0000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x20, /* 00 00000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 42 0x2a '*' */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x54, /* 0 0 0 00 */
+	0x38, /* 00   000 */
+	0x54, /* 0 0 0 00 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 43 0x2b '+' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x7c, /* 0     00 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 44 0x2c ',' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x30, /* 00  0000 */
+	0x30, /* 00  0000 */
+	0x10, /* 000 0000 */
+	0x20, /* 00 00000 */
+	0x00, /* 00000000 */
+
+	/* 45 0x2d '-' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 46 0x2e '.' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x18, /* 000  000 */
+	0x18, /* 000  000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 47 0x2f '/' */
+	0x04, /* 00000 00 */
+	0x04, /* 00000 00 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x20, /* 00 00000 */
+	0x20, /* 00 00000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x00, /* 00000000 */
+
+	/* 48 0x30 '0' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x54, /* 0 0 0 00 */
+	0x64, /* 0  00 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 49 0x31 '1' */
+	0x00, /* 00000000 */
+	0x08, /* 0000 000 */
+	0x18, /* 000  000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x1c, /* 000   00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 50 0x32 '2' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x04, /* 00000 00 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x20, /* 00 00000 */
+	0x7c, /* 0     00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 51 0x33 '3' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x04, /* 00000 00 */
+	0x18, /* 000  000 */
+	0x04, /* 00000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 52 0x34 '4' */
+	0x00, /* 00000000 */
+	0x08, /* 0000 000 */
+	0x18, /* 000  000 */
+	0x28, /* 00 0 000 */
+	0x48, /* 0 00 000 */
+	0x7c, /* 0     00 */
+	0x08, /* 0000 000 */
+	0x1c, /* 000   00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 53 0x35 '5' */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x40, /* 0 000000 */
+	0x78, /* 0    000 */
+	0x04, /* 00000 00 */
+	0x04, /* 00000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 54 0x36 '6' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x40, /* 0 000000 */
+	0x78, /* 0    000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 55 0x37 '7' */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x04, /* 00000 00 */
+	0x04, /* 00000 00 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 56 0x38 '8' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 57 0x39 '9' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x3c, /* 00    00 */
+	0x04, /* 00000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 58 0x3a ':' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x18, /* 000  000 */
+	0x18, /* 000  000 */
+	0x00, /* 00000000 */
+	0x18, /* 000  000 */
+	0x18, /* 000  000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 59 0x3b ';' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x30, /* 00  0000 */
+	0x30, /* 00  0000 */
+	0x00, /* 00000000 */
+	0x30, /* 00  0000 */
+	0x30, /* 00  0000 */
+	0x10, /* 000 0000 */
+	0x20, /* 00 00000 */
+	0x00, /* 00000000 */
+
+	/* 60 0x3c '<' */
+	0x00, /* 00000000 */
+	0x04, /* 00000 00 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x20, /* 00 00000 */
+	0x10, /* 000 0000 */
+	0x08, /* 0000 000 */
+	0x04, /* 00000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 61 0x3d '=' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 62 0x3e '>' */
+	0x00, /* 00000000 */
+	0x20, /* 00 00000 */
+	0x10, /* 000 0000 */
+	0x08, /* 0000 000 */
+	0x04, /* 00000 00 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x20, /* 00 00000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 63 0x3f '?' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x04, /* 00000 00 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 64 0x40 '@' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x74, /* 0   0 00 */
+	0x54, /* 0 0 0 00 */
+	0x78, /* 0    000 */
+	0x40, /* 0 000000 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 65 0x41 'A' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x7c, /* 0     00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 66 0x42 'B' */
+	0x00, /* 00000000 */
+	0x78, /* 0    000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x78, /* 0    000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x78, /* 0    000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 67 0x43 'C' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 68 0x44 'D' */
+	0x00, /* 00000000 */
+	0x78, /* 0    000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x78, /* 0    000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 69 0x45 'E' */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x78, /* 0    000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x7c, /* 0     00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 70 0x46 'F' */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x78, /* 0    000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 71 0x47 'G' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x40, /* 0 000000 */
+	0x4c, /* 0 00  00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 72 0x48 'H' */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x7c, /* 0     00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 73 0x49 'I' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 74 0x4a 'J' */
+	0x00, /* 00000000 */
+	0x04, /* 00000 00 */
+	0x04, /* 00000 00 */
+	0x04, /* 00000 00 */
+	0x04, /* 00000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 75 0x4b 'K' */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x48, /* 0 00 000 */
+	0x50, /* 0 0 0000 */
+	0x60, /* 0  00000 */
+	0x50, /* 0 0 0000 */
+	0x48, /* 0 00 000 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 76 0x4c 'L' */
+	0x00, /* 00000000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x7c, /* 0     00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 77 0x4d 'M' */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x6c, /* 0  0  00 */
+	0x54, /* 0 0 0 00 */
+	0x54, /* 0 0 0 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 78 0x4e 'N' */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x64, /* 0  00 00 */
+	0x54, /* 0 0 0 00 */
+	0x4c, /* 0 00  00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 79 0x4f 'O' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 80 0x50 'P' */
+	0x00, /* 00000000 */
+	0x78, /* 0    000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x78, /* 0    000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 81 0x51 'Q' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x54, /* 0 0 0 00 */
+	0x38, /* 00   000 */
+	0x04, /* 00000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 82 0x52 'R' */
+	0x00, /* 00000000 */
+	0x78, /* 0    000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x78, /* 0    000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 83 0x53 'S' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x40, /* 0 000000 */
+	0x38, /* 00   000 */
+	0x04, /* 00000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 84 0x54 'T' */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 85 0x55 'U' */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 86 0x56 'V' */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x28, /* 00 0 000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 87 0x57 'W' */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x54, /* 0 0 0 00 */
+	0x54, /* 0 0 0 00 */
+	0x6c, /* 0  0  00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 88 0x58 'X' */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x28, /* 00 0 000 */
+	0x10, /* 000 0000 */
+	0x28, /* 00 0 000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 89 0x59 'Y' */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x28, /* 00 0 000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 90 0x5a 'Z' */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x04, /* 00000 00 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x20, /* 00 00000 */
+	0x40, /* 0 000000 */
+	0x7c, /* 0     00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 91 0x5b '[' */
+	0x0c, /* 0000  00 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x0c, /* 0000  00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 92 0x5c '\' */
+	0x20, /* 00 00000 */
+	0x20, /* 00 00000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x04, /* 00000 00 */
+	0x04, /* 00000 00 */
+	0x02, /* 000000 0 */
+	0x02, /* 000000 0 */
+	0x00, /* 00000000 */
+
+	/* 93 0x5d ']' */
+	0x30, /* 00  0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x30, /* 00  0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 94 0x5e '^' */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x28, /* 00 0 000 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 95 0x5f '_' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x7e, /* 0      0 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 96 0x60 '`' */
+	0x20, /* 00 00000 */
+	0x10, /* 000 0000 */
+	0x08, /* 0000 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 97 0x61 'a' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x34, /* 00  0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 98 0x62 'b' */
+	0x00, /* 00000000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x78, /* 0    000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x78, /* 0    000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 99 0x63 'c' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x40, /* 0 000000 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 100 0x64 'd' */
+	0x00, /* 00000000 */
+	0x04, /* 00000 00 */
+	0x04, /* 00000 00 */
+	0x3c, /* 00    00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 101 0x65 'e' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x7c, /* 0     00 */
+	0x40, /* 0 000000 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 102 0x66 'f' */
+	0x00, /* 00000000 */
+	0x0c, /* 0000  00 */
+	0x10, /* 000 0000 */
+	0x38, /* 00   000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 103 0x67 'g' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x3c, /* 00    00 */
+	0x04, /* 00000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+
+	/* 104 0x68 'h' */
+	0x00, /* 00000000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x78, /* 0    000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 105 0x69 'i' */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x30, /* 00  0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 106 0x6a 'j' */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x30, /* 00  0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x60, /* 0  00000 */
+	0x00, /* 00000000 */
+
+	/* 107 0x6b 'k' */
+	0x00, /* 00000000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x48, /* 0 00 000 */
+	0x50, /* 0 0 0000 */
+	0x70, /* 0   0000 */
+	0x48, /* 0 00 000 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 108 0x6c 'l' */
+	0x00, /* 00000000 */
+	0x30, /* 00  0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 109 0x6d 'm' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x78, /* 0    000 */
+	0x54, /* 0 0 0 00 */
+	0x54, /* 0 0 0 00 */
+	0x54, /* 0 0 0 00 */
+	0x54, /* 0 0 0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 110 0x6e 'n' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x58, /* 0 0  000 */
+	0x64, /* 0  00 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 111 0x6f 'o' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 112 0x70 'p' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x78, /* 0    000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x78, /* 0    000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x00, /* 00000000 */
+
+	/* 113 0x71 'q' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x3c, /* 00    00 */
+	0x04, /* 00000 00 */
+	0x04, /* 00000 00 */
+	0x00, /* 00000000 */
+
+	/* 114 0x72 'r' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x58, /* 0 0  000 */
+	0x64, /* 0  00 00 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 115 0x73 's' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x40, /* 0 000000 */
+	0x38, /* 00   000 */
+	0x04, /* 00000 00 */
+	0x78, /* 0    000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 116 0x74 't' */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x38, /* 00   000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x0c, /* 0000  00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 117 0x75 'u' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x34, /* 00  0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 118 0x76 'v' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x28, /* 00 0 000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 119 0x77 'w' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x54, /* 0 0 0 00 */
+	0x54, /* 0 0 0 00 */
+	0x54, /* 0 0 0 00 */
+	0x54, /* 0 0 0 00 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 120 0x78 'x' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x28, /* 00 0 000 */
+	0x10, /* 000 0000 */
+	0x28, /* 00 0 000 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 121 0x79 'y' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x3c, /* 00    00 */
+	0x04, /* 00000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+
+	/* 122 0x7a 'z' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x20, /* 00 00000 */
+	0x7c, /* 0     00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 123 0x7b '{' */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x04, /* 00000 00 */
+	0x00, /* 00000000 */
+
+	/* 124 0x7c '|' */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 125 0x7d '}' */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x20, /* 00 00000 */
+	0x00, /* 00000000 */
+
+	/* 126 0x7e '~' */
+	0x00, /* 00000000 */
+	0x34, /* 00  0 00 */
+	0x58, /* 0 0  000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 127 0x7f '^?' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 128 0x80 '\200' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x7c, /* 0     00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 129 0x81 '\201' */
+	0x28, /* 00 0 000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x7c, /* 0     00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 130 0x82 '\202' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 131 0x83 '\203' */
+	0x10, /* 000 0000 */
+	0x7c, /* 0     00 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x78, /* 0    000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x7c, /* 0     00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 132 0x84 '\204' */
+	0x58, /* 0 0  000 */
+	0x44, /* 0 000 00 */
+	0x64, /* 0  00 00 */
+	0x54, /* 0 0 0 00 */
+	0x4c, /* 0 00  00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 133 0x85 '\205' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 134 0x86 '\206' */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 135 0x87 '\207' */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x34, /* 00  0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 136 0x88 '\210' */
+	0x10, /* 000 0000 */
+	0x08, /* 0000 000 */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x34, /* 00  0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 137 0x89 '\211' */
+	0x10, /* 000 0000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x34, /* 00  0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 138 0x8a '\212' */
+	0x00, /* 00000000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x34, /* 00  0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 139 0x8b '\213' */
+	0x34, /* 00  0 00 */
+	0x58, /* 0 0  000 */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x34, /* 00  0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 140 0x8c '\214' */
+	0x18, /* 000  000 */
+	0x24, /* 00 00 00 */
+	0x18, /* 000  000 */
+	0x3c, /* 00    00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x34, /* 00  0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 141 0x8d '\215' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x3c, /* 00    00 */
+	0x10, /* 000 0000 */
+	0x20, /* 00 00000 */
+	0x00, /* 00000000 */
+
+	/* 142 0x8e '\216' */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x7c, /* 0     00 */
+	0x40, /* 0 000000 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 143 0x8f '\217' */
+	0x20, /* 00 00000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x7c, /* 0     00 */
+	0x40, /* 0 000000 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 144 0x90 '\220' */
+	0x10, /* 000 0000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x7c, /* 0     00 */
+	0x40, /* 0 000000 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 145 0x91 '\221' */
+	0x00, /* 00000000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x7c, /* 0     00 */
+	0x40, /* 0 000000 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 146 0x92 '\222' */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 147 0x93 '\223' */
+	0x20, /* 00 00000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 148 0x94 '\224' */
+	0x10, /* 000 0000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 149 0x95 '\225' */
+	0x00, /* 00000000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 150 0x96 '\226' */
+	0x34, /* 00  0 00 */
+	0x58, /* 0 0  000 */
+	0x00, /* 00000000 */
+	0x58, /* 0 0  000 */
+	0x64, /* 0  00 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 151 0x97 '\227' */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 152 0x98 '\230' */
+	0x20, /* 00 00000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 153 0x99 '\231' */
+	0x10, /* 000 0000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 154 0x9a '\232' */
+	0x00, /* 00000000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 155 0x9b '\233' */
+	0x34, /* 00  0 00 */
+	0x58, /* 0 0  000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 156 0x9c '\234' */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x34, /* 00  0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 157 0x9d '\235' */
+	0x20, /* 00 00000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x34, /* 00  0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 158 0x9e '\236' */
+	0x10, /* 000 0000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x34, /* 00  0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 159 0x9f '\237' */
+	0x00, /* 00000000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x34, /* 00  0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 160 0xa0 '\240' */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x38, /* 00   000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 161 0xa1 '\241' */
+	0x18, /* 000  000 */
+	0x24, /* 00 00 00 */
+	0x24, /* 00 00 00 */
+	0x18, /* 000  000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 162 0xa2 '\242' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x38, /* 00   000 */
+	0x54, /* 0 0 0 00 */
+	0x50, /* 0 0 0000 */
+	0x54, /* 0 0 0 00 */
+	0x38, /* 00   000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 163 0xa3 '\243' */
+	0x30, /* 00  0000 */
+	0x48, /* 0 00 000 */
+	0x40, /* 0 000000 */
+	0x70, /* 0   0000 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x44, /* 0 000 00 */
+	0x78, /* 0    000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 164 0xa4 '\244' */
+	0x44, /* 0 000 00 */
+	0x24, /* 00 00 00 */
+	0x50, /* 0 0 0000 */
+	0x48, /* 0 00 000 */
+	0x24, /* 00 00 00 */
+	0x14, /* 000 0 00 */
+	0x48, /* 0 00 000 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 165 0xa5 '\245' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x7c, /* 0     00 */
+	0x7c, /* 0     00 */
+	0x7c, /* 0     00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 166 0xa6 '\246' */
+	0x3c, /* 00    00 */
+	0x54, /* 0 0 0 00 */
+	0x54, /* 0 0 0 00 */
+	0x54, /* 0 0 0 00 */
+	0x3c, /* 00    00 */
+	0x14, /* 000 0 00 */
+	0x14, /* 000 0 00 */
+	0x14, /* 000 0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 167 0xa7 '\247' */
+	0x18, /* 000  000 */
+	0x24, /* 00 00 00 */
+	0x44, /* 0 000 00 */
+	0x48, /* 0 00 000 */
+	0x48, /* 0 00 000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x58, /* 0 0  000 */
+	0x40, /* 0 000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 168 0xa8 '\250' */
+	0x00, /* 00000000 */
+	0x70, /* 0   0000 */
+	0x08, /* 0000 000 */
+	0x64, /* 0  00 00 */
+	0x54, /* 0 0 0 00 */
+	0x64, /* 0  00 00 */
+	0x58, /* 0 0  000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 169 0xa9 '\251' */
+	0x00, /* 00000000 */
+	0x70, /* 0   0000 */
+	0x08, /* 0000 000 */
+	0x34, /* 00  0 00 */
+	0x44, /* 0 000 00 */
+	0x34, /* 00  0 00 */
+	0x08, /* 0000 000 */
+	0x70, /* 0   0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 170 0xaa '\252' */
+	0x00, /* 00000000 */
+	0x7a, /* 0    0 0 */
+	0x2e, /* 00 0   0 */
+	0x2e, /* 00 0   0 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 171 0xab '\253' */
+	0x00, /* 00000000 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 172 0xac '\254' */
+	0x00, /* 00000000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 173 0xad '\255' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x08, /* 0000 000 */
+	0x7c, /* 0     00 */
+	0x10, /* 000 0000 */
+	0x7c, /* 0     00 */
+	0x20, /* 00 00000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 174 0xae '\256' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x50, /* 0 0 0000 */
+	0x50, /* 0 0 0000 */
+	0x78, /* 0    000 */
+	0x50, /* 0 0 0000 */
+	0x50, /* 0 0 0000 */
+	0x5c, /* 0 0   00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 175 0xaf '\257' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x4c, /* 0 00  00 */
+	0x54, /* 0 0 0 00 */
+	0x64, /* 0  00 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 176 0xb0 '\260' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x6c, /* 0  0  00 */
+	0x54, /* 0 0 0 00 */
+	0x6c, /* 0  0  00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 177 0xb1 '\261' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x7c, /* 0     00 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x7c, /* 0     00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 178 0xb2 '\262' */
+	0x00, /* 00000000 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x20, /* 00 00000 */
+	0x10, /* 000 0000 */
+	0x08, /* 0000 000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 179 0xb3 '\263' */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x08, /* 0000 000 */
+	0x04, /* 00000 00 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x1c, /* 000   00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 180 0xb4 '\264' */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x28, /* 00 0 000 */
+	0x7c, /* 0     00 */
+	0x10, /* 000 0000 */
+	0x7c, /* 0     00 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 181 0xb5 '\265' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x48, /* 0 00 000 */
+	0x48, /* 0 00 000 */
+	0x48, /* 0 00 000 */
+	0x48, /* 0 00 000 */
+	0x74, /* 0   0 00 */
+	0x40, /* 0 000000 */
+	0x40, /* 0 000000 */
+	0x00, /* 00000000 */
+
+	/* 182 0xb6 '\266' */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x08, /* 0000 000 */
+	0x0c, /* 0000  00 */
+	0x14, /* 000 0 00 */
+	0x24, /* 00 00 00 */
+	0x24, /* 00 00 00 */
+	0x18, /* 000  000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 183 0xb7 '\267' */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x24, /* 00 00 00 */
+	0x10, /* 000 0000 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x24, /* 00 00 00 */
+	0x7c, /* 0     00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 184 0xb8 '\270' */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x28, /* 00 0 000 */
+	0x28, /* 00 0 000 */
+	0x28, /* 00 0 000 */
+	0x28, /* 00 0 000 */
+	0x28, /* 00 0 000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 185 0xb9 '\271' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x28, /* 00 0 000 */
+	0x28, /* 00 0 000 */
+	0x28, /* 00 0 000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 186 0xba '\272' */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x60, /* 0  00000 */
+	0x00, /* 00000000 */
+
+	/* 187 0xbb '\273' */
+	0x00, /* 00000000 */
+	0x1c, /* 000   00 */
+	0x24, /* 00 00 00 */
+	0x24, /* 00 00 00 */
+	0x1c, /* 000   00 */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 188 0xbc '\274' */
+	0x00, /* 00000000 */
+	0x18, /* 000  000 */
+	0x24, /* 00 00 00 */
+	0x24, /* 00 00 00 */
+	0x18, /* 000  000 */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 189 0xbd '\275' */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x28, /* 00 0 000 */
+	0x6c, /* 0  0  00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 190 0xbe '\276' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x54, /* 0 0 0 00 */
+	0x5c, /* 0 0   00 */
+	0x50, /* 0 0 0000 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 191 0xbf '\277' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x4c, /* 0 00  00 */
+	0x54, /* 0 0 0 00 */
+	0x64, /* 0  00 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 192 0xc0 '\300' */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x20, /* 00 00000 */
+	0x40, /* 0 000000 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 193 0xc1 '\301' */
+	0x00, /* 00000000 */
+	0x08, /* 0000 000 */
+	0x00, /* 00000000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x08, /* 0000 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 194 0xc2 '\302' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x04, /* 00000 00 */
+	0x04, /* 00000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 195 0xc3 '\303' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x0c, /* 0000  00 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x50, /* 0 0 0000 */
+	0x20, /* 00 00000 */
+	0x20, /* 00 00000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 196 0xc4 '\304' */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x38, /* 00   000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x60, /* 0  00000 */
+	0x00, /* 00000000 */
+
+	/* 197 0xc5 '\305' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x04, /* 00000 00 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x40, /* 0 000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 198 0xc6 '\306' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x10, /* 000 0000 */
+	0x28, /* 00 0 000 */
+	0x28, /* 00 0 000 */
+	0x44, /* 0 000 00 */
+	0x7c, /* 0     00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 199 0xc7 '\307' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x24, /* 00 00 00 */
+	0x48, /* 0 00 000 */
+	0x48, /* 0 00 000 */
+	0x24, /* 00 00 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 200 0xc8 '\310' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x48, /* 0 00 000 */
+	0x24, /* 00 00 00 */
+	0x24, /* 00 00 00 */
+	0x48, /* 0 00 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 201 0xc9 '\311' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x54, /* 0 0 0 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 202 0xca '\312' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 203 0xcb '\313' */
+	0x10, /* 000 0000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x7c, /* 0     00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 204 0xcc '\314' */
+	0x58, /* 0 0  000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x7c, /* 0     00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 205 0xcd '\315' */
+	0x58, /* 0 0  000 */
+	0x38, /* 00   000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 206 0xce '\316' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x50, /* 0 0 0000 */
+	0x50, /* 0 0 0000 */
+	0x58, /* 0 0  000 */
+	0x50, /* 0 0 0000 */
+	0x50, /* 0 0 0000 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 207 0xcf '\317' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x28, /* 00 0 000 */
+	0x54, /* 0 0 0 00 */
+	0x5c, /* 0 0   00 */
+	0x50, /* 0 0 0000 */
+	0x2c, /* 00 0  00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 208 0xd0 '\320' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 209 0xd1 '\321' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x7e, /* 0      0 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 210 0xd2 '\322' */
+	0x00, /* 00000000 */
+	0x14, /* 000 0 00 */
+	0x28, /* 00 0 000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 211 0xd3 '\323' */
+	0x00, /* 00000000 */
+	0x14, /* 000 0 00 */
+	0x14, /* 000 0 00 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 212 0xd4 '\324' */
+	0x00, /* 00000000 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x18, /* 000  000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 213 0xd5 '\325' */
+	0x00, /* 00000000 */
+	0x18, /* 000  000 */
+	0x08, /* 0000 000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 214 0xd6 '\326' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x7c, /* 0     00 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 215 0xd7 '\327' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x10, /* 000 0000 */
+	0x28, /* 00 0 000 */
+	0x44, /* 0 000 00 */
+	0x28, /* 00 0 000 */
+	0x10, /* 000 0000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 216 0xd8 '\330' */
+	0x00, /* 00000000 */
+	0x28, /* 00 0 000 */
+	0x00, /* 00000000 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x44, /* 0 000 00 */
+	0x3c, /* 00    00 */
+	0x04, /* 00000 00 */
+	0x38, /* 00   000 */
+	0x00, /* 00000000 */
+
+	/* 217 0xd9 '\331' */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x7e, /* 0      0 */
+	0x00, /* 00000000 */
+	0x7e, /* 0      0 */
+	0x00, /* 00000000 */
+	0x7e, /* 0      0 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 218 0xda '\332' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 219 0xdb '\333' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 220 0xdc '\334' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 221 0xdd '\335' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 222 0xde '\336' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 223 0xdf '\337' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 224 0xe0 '\340' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 225 0xe1 '\341' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 226 0xe2 '\342' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 227 0xe3 '\343' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 228 0xe4 '\344' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 229 0xe5 '\345' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 230 0xe6 '\346' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 231 0xe7 '\347' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 232 0xe8 '\350' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 233 0xe9 '\351' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 234 0xea '\352' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 235 0xeb '\353' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 236 0xec '\354' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 237 0xed '\355' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 238 0xee '\356' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 239 0xef '\357' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 240 0xf0 '\360' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 241 0xf1 '\361' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 242 0xf2 '\362' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 243 0xf3 '\363' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 244 0xf4 '\364' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 245 0xf5 '\365' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 246 0xf6 '\366' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 247 0xf7 '\367' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 248 0xf8 '\370' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 249 0xf9 '\371' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 250 0xfa '\372' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 251 0xfb '\373' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 252 0xfc '\374' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 253 0xfd '\375' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 254 0xfe '\376' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+	/* 255 0xff '\377' */
+	0x00, /* 00000000 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x3c, /* 00    00 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+	0x00, /* 00000000 */
+
+};
+
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/fonts.c m68k-2.1.72/drivers/video/fonts.c
--- m68k-2.1.72-status/drivers/video/fonts.c	Mon Nov 24 23:26:55 1997
+++ m68k-2.1.72/drivers/video/fonts.c	Wed Jan  7 22:03:28 1998
@@ -9,6 +9,7 @@
  */
 
 
+#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #ifdef __mc68000__
@@ -36,6 +37,11 @@
 extern int fontwidth_pearl8x8, fontheight_pearl8x8;
 extern u_char fontdata_pearl8x8[];
 
+/* VGA6x11 */
+extern char fontname_6x11[];
+extern int fontwidth_6x11, fontheight_6x11;
+extern u_char fontdata_6x11[];
+
 
    /*
     *    Font Descriptor Array
@@ -51,12 +57,14 @@
 #define VGA8x8_IDX	0
 #define VGA8x16_IDX	1
 #define PEARL8x8_IDX	2
+#define VGA6x11_IDX	3
 
 static struct softfontdesc softfonts[] = {
    { fontname_8x8, &fontwidth_8x8, &fontheight_8x8, fontdata_8x8 },
    { fontname_8x16, &fontwidth_8x16, &fontheight_8x16, fontdata_8x16 },
    { fontname_pearl8x8, &fontwidth_pearl8x8, &fontheight_pearl8x8,
      fontdata_pearl8x8 },
+   { fontname_6x11, &fontwidth_6x11, &fontheight_6x11, fontdata_6x11 },
 };
 
 static unsigned int numsoftfonts = sizeof(softfonts)/sizeof(*softfonts);
@@ -101,6 +109,16 @@
 #endif
     } else
 	i = VGA8x16_IDX;
+
+#if defined(CONFIG_MAC)
+    if (MACH_IS_MAC) {
+#if 0  /* MSch: removed until 6x11 is debugged */
+        i = VGA6x11_IDX;   /* I added this for fun ... I like 6x11 */
+#endif
+       if (xres < 640)
+           i = VGA6x11_IDX;
+    }
+#endif
 
     if (name)
 	*name = softfonts[i].name;
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/macfb.c m68k-2.1.72/drivers/video/macfb.c
--- m68k-2.1.72-status/drivers/video/macfb.c	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/macfb.c	Wed Jan  7 22:03:28 1998
@@ -0,0 +1,423 @@
+/*
+ *	We've been given MAC frame buffer info by the booter. Now go set it up
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/tty.h>
+#include <linux/malloc.h>
+#include <linux/delay.h>
+#include <linux/nubus.h>
+#include <linux/init.h>
+
+#include <asm/setup.h>
+#include <asm/bootinfo.h>
+#include <asm/uaccess.h>
+#include <asm/pgtable.h>
+#include <asm/irq.h>
+#include <asm/macintosh.h>
+#include <linux/fb.h>
+
+#define arraysize(x)    (sizeof(x)/sizeof(*(x)))
+
+static struct fb_var_screeninfo macfb_defined={
+	0,0,0,0,	/* W,H, W, H (virtual) load xres,xres_virtual*/
+	0,0,		/* virtual -> visible no offset */
+	8,		/* depth -> load bits_per_pixel */
+	0,		/* greyscale ? */
+	{0,0,0},	/* R */
+	{0,0,0},	/* G */
+	{0,0,0},	/* B */
+	{0,0,0},	/* transparency */
+	0,		/* standard pixel format */
+	FB_ACTIVATE_NOW,
+	274,195,	/* 14" monitor *Mikael Nykvist's anyway* */
+	FB_ACCEL_NONE,	/* The only way to accelerate a mac is .. */
+	0L,0L,0L,0L,0L,
+	0L,0L,0,	/* No sync info */
+	FB_VMODE_NONINTERLACED,
+	{0,0,0,0,0,0}
+};
+
+#define NUM_TOTAL_MODES		1
+#define NUM_PREDEF_MODES	1
+
+static struct display disp;
+static struct fb_info fb_info;
+
+static int inverse = 0;
+
+struct macfb_par
+{
+	void *unused;
+};
+
+static int currcon = 0;
+static int current_par_valid = 0;
+struct macfb_par current_par;
+
+static int mac_xres,mac_yres,mac_depth, mac_xbytes, mac_vxres;
+static unsigned long mac_videobase;
+static unsigned long mac_videosize;
+
+	/*
+	 * Open/Release the frame buffer device
+	 */
+
+static int macfb_open(struct fb_info *info)
+{
+	/*
+	 * Nothing, only a usage count for the moment
+	 */
+	MOD_INC_USE_COUNT;
+	return(0);
+}
+
+static int macfb_release(struct fb_info *info)
+{
+	MOD_DEC_USE_COUNT;
+	return(0);
+}
+
+static void macfb_encode_var(struct fb_var_screeninfo *var, 
+				struct macfb_par *par)
+{
+	int i=0;
+	var->xres=mac_xres;
+	var->yres=mac_yres;
+	var->xres_virtual=mac_vxres;
+	var->yres_virtual=var->yres;
+	var->xoffset=0;
+	var->yoffset=0;
+	var->bits_per_pixel = mac_depth;
+	var->grayscale=0;
+	var->transp.offset=0;
+	var->transp.length=0;
+	var->transp.msb_right=0;
+	var->nonstd=0;
+	var->activate=0;
+	var->height= -1;
+	var->width= -1;
+	var->accel=0;
+	var->vmode=FB_VMODE_NONINTERLACED;
+	var->pixclock=0;
+	var->sync=0;
+	var->left_margin=0;
+	var->right_margin=0;
+	var->upper_margin=0;
+	var->lower_margin=0;
+	var->hsync_len=0;
+	var->vsync_len=0;
+	for(i=0;i<arraysize(var->reserved);i++)
+		var->reserved[i]=0;
+	return;
+}
+
+
+static void macfb_get_par(struct macfb_par *par)
+{
+	*par=current_par;
+}
+
+static void macfb_set_par(struct macfb_par *par)
+{
+	current_par_valid=1;
+}
+
+static int fb_update_var(int con, struct fb_info *info)
+{
+	return 0;
+}
+
+static int do_fb_set_var(struct fb_var_screeninfo *var, int isactive)
+{
+	struct macfb_par par;
+	
+	macfb_get_par(&par);
+	macfb_encode_var(var, &par);
+	return 0;
+}
+
+extern int console_loglevel;
+
+static void macfb_encode_fix(struct fb_fix_screeninfo *fix, 
+				struct macfb_par *par)
+{
+	int i;
+
+	memset(fix, 0, sizeof(struct fb_fix_screeninfo));
+	strcpy(fix->id,"Macintosh");
+
+	/*
+	 * X works, but screen wraps ... 
+	 */
+	fix->smem_start=(char *)(mac_videobase&PAGE_MASK);
+	fix->smem_offset=(mac_videobase&~PAGE_MASK);
+	fix->smem_len=PAGE_ALIGN(mac_videosize);
+	fix->type = FB_TYPE_PACKED_PIXELS;
+	fix->visual = FB_VISUAL_PSEUDOCOLOR;
+	fix->xpanstep=0;
+	fix->ypanstep=0;
+	fix->ywrapstep=0;
+	fix->line_length=mac_xbytes;
+	return;
+}
+
+static int macfb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			 struct fb_info *info)
+{
+	struct macfb_par par;
+	macfb_get_par(&par);
+	macfb_encode_fix(fix, &par);
+	return 0;
+}
+
+static int macfb_get_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info)
+{
+	struct macfb_par par;
+	if(con==-1)
+	{
+		macfb_get_par(&par);
+		macfb_encode_var(var, &par);
+	}
+	else
+		*var=fb_display[con].var;
+	return 0;
+}
+
+static void macfb_set_disp(int con)
+{
+	struct fb_fix_screeninfo fix;
+	struct display *display;
+	
+	if (con >= 0)
+		display = &fb_display[con];
+	else
+		display = &disp;	/* used during initialization */
+
+	macfb_get_fix(&fix, con, 0);
+
+	display->screen_base = (u_char *)(fix.smem_start+fix.smem_offset);
+	display->visual = fix.visual;
+	display->type = fix.type;
+	display->type_aux = fix.type_aux;
+	display->ypanstep = fix.ypanstep;
+	display->ywrapstep = fix.ywrapstep;
+	display->line_length = fix.line_length;
+	display->next_line = fix.line_length;
+	display->can_soft_blank = 0;
+	display->inverse = inverse;
+
+}
+
+static int macfb_set_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info)
+{
+	int err;
+	
+	if ((err=do_fb_set_var(var, 1)))
+		return err;
+	return 0;
+}
+
+static int macfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info)
+{
+	printk("macfb_get_cmap: not supported!\n");
+#if 0
+	/* interferes with X11 */
+	if (console_loglevel < 7)
+		return -EINVAL;
+	if (con == currcon) /* current console? */
+		return fb_get_cmap(cmap, &fb_display[con].var, kspc, 0 /*offb_getcolreg*/, info);
+	else if (fb_display[con].cmap.len) /* non default colormap? */
+		fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
+	else
+		fb_copy_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
+		     cmap, kspc ? 0 : 2);
+#endif
+	return 0;
+
+}
+
+static int macfb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info)
+{
+	printk("macfb_set_cmap: not supported!\n");
+#if 0
+	if (console_loglevel < 7)
+		return -EINVAL;
+	if (!fb_display[con].cmap.len) {	/* no colormap allocated? */
+		if ((err = fb_alloc_cmap(&fb_display[con].cmap,
+				 1<<fb_display[con].var.bits_per_pixel, 0)))
+		return err;
+	}
+	if (con == currcon)			/* current console? */
+		return fb_set_cmap(cmap, &fb_display[con].var, kspc, 1 /*offb_setcolreg*/, info);
+	else
+		fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
+#endif
+	return 0;
+}
+
+static int macfb_pan_display(struct fb_var_screeninfo *var, int con,
+			     struct fb_info *info)
+{
+	/* no panning */
+	printk("macfb_pan: not supported!\n");
+	return -EINVAL;
+}
+
+static int macfb_ioctl(struct inode *inode, struct file *file, 
+		       unsigned int cmd, unsigned long arg, int con,
+		       struct fb_info *info)
+{
+	printk("macfb_ioctl: not supported!\n");
+	return -EINVAL;
+}
+
+static struct fb_ops macfb_ops = {
+	macfb_open,
+	macfb_release,
+	macfb_get_fix,
+	macfb_get_var,
+	macfb_set_var,
+	macfb_get_cmap,
+	macfb_set_cmap,
+	macfb_pan_display,
+	macfb_ioctl
+};
+
+void macfb_setup(char *options, int *ints)
+{
+    char *this_opt;
+    int temp;
+
+    fb_info.fontname[0] = '\0';
+
+    if (!options || !*options)
+		return;
+     
+    for(this_opt=strtok(options,","); this_opt; this_opt=strtok(NULL,",")) {
+	if (!*this_opt) continue;
+
+	if (! strcmp(this_opt, "inverse"))
+		inverse=1;
+	else if (!strncmp(this_opt, "font:", 5)) {
+	   strcpy(fb_info.fontname, this_opt+5);
+	   printk("macfb_setup: option %s\n", this_opt);
+	}
+    }
+}
+
+static int macfb_switch(int con, struct fb_info *info)
+{
+	do_fb_set_var(&fb_display[con].var,1);
+	currcon=con;
+	return 0;
+}
+
+/* 0 unblank, 1 blank, 2 no vsync, 3 no hsync, 4 off */
+
+static void macfb_blank(int blank, struct fb_info *info)
+{
+	/* Not supported */
+}
+
+/*
+ *	Nubus call back. This will give us our board identity and also
+ *	other useful info we need later
+ */
+ 
+static int nubus_video_card(struct nubus_device_specifier *ns, int slot, struct nubus_type *nt)
+{
+	if(nt->category==NUBUS_CAT_DISPLAY)
+		return 0;
+	/* Claim all video cards. We dont yet do driver specifics tho. */
+	return -ENODEV;
+}
+
+static struct nubus_device_specifier nb_video={
+	nubus_video_card,
+	NULL
+};
+
+__initfunc(unsigned long macfb_init(unsigned long mem_start))
+{
+	/* nubus_remap the video .. */
+	int err;
+
+	if (!MACH_IS_MAC) 
+		return mem_start;
+
+	mac_xres=mac_bi_data.dimensions&0xFFFF;
+	mac_yres=(mac_bi_data.dimensions&0xFFFF0000)>>16;
+	mac_depth=mac_bi_data.videodepth;
+	mac_xbytes=mac_bi_data.videorow;
+	mac_vxres = (mac_xbytes/mac_depth)*8;
+	mac_videosize=mac_xbytes*mac_yres;
+	mac_videobase=mac_bi_data.videoaddr;
+
+	printk("macfb_init: xres %d yres %d bpp %d addr %x size %d \n",
+		mac_xres, mac_yres, mac_depth, mac_videobase, mac_videosize);
+
+	mac_debugging_penguin(4);
+	
+	/*
+	 *	Fill in the available video resolution
+	 */
+	 
+	 macfb_defined.xres=mac_xres;
+	 macfb_defined.yres=mac_yres;
+	 macfb_defined.xres_virtual=mac_vxres;
+	 macfb_defined.yres_virtual=mac_yres;
+	 macfb_defined.bits_per_pixel=mac_depth;
+	 
+	 
+	/*
+	 *	Let there be consoles..
+	 */
+	strcpy(fb_info.modename, "Macintosh Builtin ");
+	fb_info.changevar = NULL;
+	fb_info.node = -1;
+	fb_info.fbops = &macfb_ops;
+	fb_info.disp=&disp;
+	fb_info.switch_con=&macfb_switch;
+	fb_info.updatevar=&fb_update_var;
+	fb_info.blank=&macfb_blank;
+	do_fb_set_var(&macfb_defined,1);
+
+	err=register_framebuffer(&fb_info);
+	if(err<0)
+	{
+		mac_boom(6);
+		return NULL;
+	}
+
+	macfb_get_var(&disp.var, -1, &fb_info));
+	macfb_set_disp(-1);
+	
+	/*
+	 *	Register the nubus hook
+	 */
+	 
+	register_nubus_device(&nb_video);
+	
+	return mem_start;
+}
+
+#if 0
+/*
+ * These two auxiliary debug functions should go away ASAP. Only usage: 
+ * before the console output is up (after head.S come some other crucial
+ * setup routines :-) 
+ *
+ * Now in debug.c ...
+ */
+#endif
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/mach64fb.c m68k-2.1.72/drivers/video/mach64fb.c
--- m68k-2.1.72-status/drivers/video/mach64fb.c	Wed Dec 17 23:56:36 1997
+++ m68k-2.1.72/drivers/video/mach64fb.c	Thu Jan  8 00:05:39 1998
@@ -248,26 +248,29 @@
     *    Interface to the low level console driver exported with fb_info
     */
 
-static int  Mach64fb_switch(int con);
-static int  Mach64fb_updatevar(int con);
-static void Mach64fb_blank(int blank);
+static int  Mach64fb_switch(int con, struct fb_info *info);
+static int  Mach64fb_updatevar(int con, struct fb_info *info);
+static void Mach64fb_blank(int blank, struct fb_info *info);
 
 /*--------------------------------------------------------------------------*/
    /*
     *    Interface fb_ops used by the world exported with fb_info.fb_ops
     */
 
-static int M64_op_open(int fbidx);
-static int M64_op_release(int fbidx);
-static int M64_op_get_fix(struct fb_fix_screeninfo * fix, int con, int fbidx);
-static int M64_op_get_var(struct fb_var_screeninfo * var, int con, int fbidx);
-static int M64_op_set_var(struct fb_var_screeninfo * var, int con, int fbidx);
+static int M64_op_open(struct fb_info *info);
+static int M64_op_release(struct fb_info *info);
+static int M64_op_get_fix(struct fb_fix_screeninfo * fix, int con,
+			  struct fb_info *info);
+static int M64_op_get_var(struct fb_var_screeninfo * var, int con,
+			  struct fb_info *info);
+static int M64_op_set_var(struct fb_var_screeninfo * var, int con,
+			  struct fb_info *info);
 static int M64_op_get_cmap(struct fb_cmap * cmap, int kspc, int con,
-			   int fbidx);
+			   struct fb_info *info);
 static int M64_op_set_cmap(struct fb_cmap * cmap, int kspc, int con,
-			   int fbidx);
+			   struct fb_info *info);
 static int M64_op_pan_display(struct fb_var_screeninfo * var, int con,
-			      int fbidx);
+			      struct fb_info *info);
 
 static int 
 M64_op_ioctl(
@@ -276,7 +279,7 @@
   u_int cmd,
   u_long arg,
   int con,
-  int fbidx);
+  struct fb_info *info);
 
 /*--------------------------------------------------------------------------*/
    /*
@@ -287,10 +290,10 @@
 do_fb_set_var(struct fb_var_screeninfo * var, int isactive);
 
 static void 
-do_install_cmap(int con);
+do_install_cmap(int con, struct fb_info *info);
 
 static void 
-mach64fb_set_disp(int con);
+mach64fb_set_disp(int con, struct fb_info *info);
 
 static int 
 get_video_mode(const char * name);
@@ -330,10 +333,12 @@
   u_int * red,
   u_int * green,
   u_int * blue,
-  u_int * transp);
+  u_int * transp,
+  struct fb_info *info);
 
 static int 
-M64_hw_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp);
+M64_hw_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp,
+				 struct fb_info *info);
 
 static void 
 M64_hw_blank(int blank);
@@ -404,9 +409,9 @@
   void (*get_par)(struct mach64fb_par * par );
   void (*set_par)(struct mach64fb_par * par );
   int (*getcolreg)(u_int regno, u_int * red, u_int * green, u_int * blue,
-    u_int * transp);
+    u_int * transp, struct fb_info *info);
   int (*setcolreg)(u_int regno, u_int red, u_int green, u_int blue,
-    u_int transp);
+    u_int transp, struct fb_info *info);
   void (*blank)(int blank);
   void (*set_screen_base)( unsigned long s_base );
   int  (*pan_display)( struct fb_var_screeninfo * var);
@@ -809,13 +814,13 @@
 /*--------------------------------------------------------------------------*/
 
 static int 
-M64_op_open(int fbidx)
+M64_op_open(struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
 
   /*--------------------------------------------------------------------------*/
-  OFuncId("M64_op_open(%02d) \n", fbidx);
+  OFuncId("M64_op_open(%p) \n", info);
   /*
    * Nothing, only a usage count for the moment
    */
@@ -831,7 +836,7 @@
 /*--------------------------------------------------------------------------*/
 
 static int 
-M64_op_release(int fbidx)
+M64_op_release(struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -986,8 +991,8 @@
 
   mach64fb_debug = 0x018FC100;
 
-  M64_hw_setcolreg (255, 56, 100, 160, 0);
-  M64_hw_setcolreg (254, 0, 0, 0, 0);
+  M64_hw_setcolreg (255, 56, 100, 160, 0, NULL /* unused */);
+  M64_hw_setcolreg (254, 0, 0, 0, 0, NULL /* unused */);
 
   FuncDone("M64_hw_init() done.\n");
   return(1);    /* detected_mode */
@@ -1200,7 +1205,8 @@
   u_int red,
   u_int green,
   u_int blue,
-  u_int transp)
+  u_int transp,
+  struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -1251,7 +1257,8 @@
   u_int * red,
   u_int * green,
   u_int * blue,
-  u_int * transp)
+  u_int * transp,
+  struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -1646,7 +1653,7 @@
 /*--------------------------------------------------------------------------*/
 
 static void 
-do_install_cmap(int con)
+do_install_cmap(int con, struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -1661,14 +1668,16 @@
     fb_set_cmap(&fb_display[con].cmap,
       &fb_display[con].var,
       1,
-      fbhws_ptr->setcolreg);
+      fbhws_ptr->setcolreg,
+      info);
   }
   else
   {
-    fb_set_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
+    fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
       &fb_display[con].var,
       1,
-      fbhws_ptr->setcolreg);
+      fbhws_ptr->setcolreg,
+      info);
   }
   /*endif*/
 
@@ -1686,7 +1695,7 @@
 /*--------------------------------------------------------------------------*/
 
 static int 
-M64_op_get_fix(struct fb_fix_screeninfo * fix, int con, int fbidx)
+M64_op_get_fix(struct fb_fix_screeninfo * fix, int con, struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -1718,7 +1727,7 @@
 /*--------------------------------------------------------------------------*/
 
 static int 
-M64_op_get_var(struct fb_var_screeninfo *var, int con, int fbidx)
+M64_op_get_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -1747,7 +1756,7 @@
 /*--------------------------------------------------------------------------*/
 
 static void 
-mach64fb_set_disp(int con)
+mach64fb_set_disp(int con, struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -1764,8 +1773,7 @@
   else
     disp_p = &m_disp __MN__  ;  	/* used during initialization */
 
-  /* ### FN: Needs fixes later */
-  M64_op_get_fix(&fix, con, 0);
+  M64_op_get_fix(&fix, con, info);
 
   if(con == -1)  con = 0;
 
@@ -1803,7 +1811,7 @@
 /*--------------------------------------------------------------------------*/
 
 static int 
-M64_op_set_var(struct fb_var_screeninfo * var, int con, int fbidx)
+M64_op_set_var(struct fb_var_screeninfo * var, int con, struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -1827,10 +1835,10 @@
       oldvxres != var->xres_virtual || oldvyres != var->yres_virtual ||
       oldbpp != var->bits_per_pixel)
     {
-      mach64fb_set_disp(con);
+      mach64fb_set_disp(con, info);
       (*fb_info __MN__  .changevar)(con);
       fb_alloc_cmap(&fb_display[con].cmap, 0, 0);
-      do_install_cmap(con);
+      do_install_cmap(con, info);
     }
   }
   /*endif*/
@@ -1850,7 +1858,7 @@
 /*--------------------------------------------------------------------------*/
 
 static int 
-M64_op_get_cmap(struct fb_cmap * cmap, int kspc, int con, int fbidx)
+M64_op_get_cmap(struct fb_cmap * cmap, int kspc, int con, struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -1860,7 +1868,8 @@
 
   if(con == currcon) /* current console? */
   {
-    return(fb_get_cmap(cmap, &fb_display[con].var, kspc, fbhws_ptr->getcolreg));
+    return(fb_get_cmap(cmap, &fb_display[con].var, kspc, fbhws_ptr->getcolreg,
+		       info));
   }
   else if(fb_display[con].cmap.len) /* non default colormap? */
   {
@@ -1868,7 +1877,7 @@
   }
   else
   {
-    fb_copy_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
+    fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
       cmap, kspc ? 0 : 2);
   }
   /*endif*/
@@ -1887,7 +1896,7 @@
 /*--------------------------------------------------------------------------*/
 
 static int 
-M64_op_set_cmap(struct fb_cmap * cmap, int kspc, int con, int fbidx)
+M64_op_set_cmap(struct fb_cmap * cmap, int kspc, int con, struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -1910,7 +1919,8 @@
   /*endif*/
   if(con == currcon)              /* current console? */
   {
-    return(fb_set_cmap(cmap, &fb_display[con].var, kspc, fbhws_ptr->setcolreg));
+    return(fb_set_cmap(cmap, &fb_display[con].var, kspc, fbhws_ptr->setcolreg,
+		       info));
   }
   else
   {
@@ -1934,7 +1944,8 @@
 /*--------------------------------------------------------------------------*/
 
 static int 
-M64_op_pan_display(struct fb_var_screeninfo *var, int con, int fbidx)
+M64_op_pan_display(struct fb_var_screeninfo *var, int con,
+		   struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -1962,7 +1973,7 @@
   u_int          cmd,
   u_long         arg,
   int            con,
-  int            fbidx)
+  struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -2354,9 +2365,9 @@
 
   do_fb_set_var(&mach64fb_predefined[0], 1);
 
-  M64_op_get_var(&m_disp __MN__  .var, -1, GET_FB_IDX(fb_info.node));
+  M64_op_get_var(&m_disp __MN__  .var, -1, &fb_info);
 					    /* fill in m_disp.var */
-  mach64fb_set_disp(-1);                    /* fill in the rest of m_disp  */
+  mach64fb_set_disp(-1, &fb_info);          /* fill in the rest of m_disp  */
 
   Iprint(" Determined %dx%d, depth %d $%08lX MEM @ $%08lX IO @ $%08lX $%08lX\n",
     m_disp __MN__  .var.xres,
@@ -2366,7 +2377,7 @@
     phys_vmembase __MN__  ,
     phys_vgaiobase __MN__  ,
     phys_guiregbase __MN__  );
-  do_install_cmap(0);
+  do_install_cmap(0, &fb_info);
 
   Iprint(
     " %s FB device %d, using %ldK of video MEM @ $%08lX IO @ $%08lX $%08lX\n",
@@ -2389,7 +2400,7 @@
 /*--------------------------------------------------------------------------*/
 
 static int 
-Mach64fb_switch(int con)
+Mach64fb_switch(int con, struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -2402,13 +2413,14 @@
     fb_get_cmap(&fb_display[currcon].cmap,
       &fb_display[currcon].var,
       1,
-      fbhws_ptr->getcolreg);
+      fbhws_ptr->getcolreg,
+      info);
   }
   /*endif*/
   do_fb_set_var(&fb_display[con].var, 1);
   currcon = con;
   /* Install new colormap */
-  do_install_cmap(con);
+  do_install_cmap(con, info);
   return(0);
 }
 /*endproc*/
@@ -2426,7 +2438,7 @@
 /*--------------------------------------------------------------------------*/
 
 static int 
-Mach64fb_updatevar(int con)
+Mach64fb_updatevar(int con, struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
@@ -2447,7 +2459,7 @@
 /*--------------------------------------------------------------------------*/
 
 static void 
-Mach64fb_blank(int blank)
+Mach64fb_blank(int blank, struct fb_info *info)
 
 /*--------------------------------------------------------------------------*/
 {
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/offb.c m68k-2.1.72/drivers/video/offb.c
--- m68k-2.1.72-status/drivers/video/offb.c	Wed Dec 24 13:01:12 1997
+++ m68k-2.1.72/drivers/video/offb.c	Wed Jan  7 22:03:28 1998
@@ -12,6 +12,7 @@
  *  more details.
  */
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -25,25 +26,26 @@
 #include <linux/fb.h>
 #include <linux/selection.h>
 #include <linux/init.h>
+#ifdef CONFIG_FB_COMPAT_XPMAC
+#include <linux/vc_ioctl.h>
+#endif
 #include <asm/io.h>
 #include <asm/prom.h>
 
-/*
- * FIXME: for now the colormap stuff supports only one board
- */
 
 static int currcon = 0;
-static struct display fb_disp[FB_MAX];
-static struct fb_info fb_info[FB_MAX];
-static struct { u_char red, green, blue, pad; } palette[FB_MAX][256];
-
-static volatile unsigned char *unknown_cmap_adr = NULL;
-static volatile unsigned char *unknown_cmap_data = NULL;
 
-static struct fb_fix_screeninfo fb_fix[FB_MAX] = { { "OFfb ", } };
-static struct fb_var_screeninfo fb_var[FB_MAX] = { { 0, } };
+struct fb_info_offb {
+    struct fb_info info;
+    struct fb_fix_screeninfo fix;
+    struct fb_var_screeninfo var;
+    struct display disp;
+    struct { u_char red, green, blue, pad; } palette[256];
+    volatile unsigned char *cmap_adr;
+    volatile unsigned char *cmap_data;
+};
 
-static unsigned int fbidx2dpy[FB_MAX];
+static struct fb_info_offb fb_info[FB_MAX];
 
 #ifdef __powerpc__
 #define mach_eieio()	eieio()
@@ -51,31 +53,49 @@
 #define mach_eieio()	do {} while (0)
 #endif
 
+static int ofonly = 0;
+
 
     /*
      *  Interface used by the world
      */
 
-static int offb_open(int fbidx);
-static int offb_release(int fbidx);
-static int offb_get_fix(struct fb_fix_screeninfo *fix, int con, int fbidx);
-static int offb_get_var(struct fb_var_screeninfo *var, int con, int fbidx);
-static int offb_set_var(struct fb_var_screeninfo *var, int con, int fbidx);
-static int offb_pan_display(struct fb_var_screeninfo *var, int con, int fbidx);
-static int offb_get_cmap(struct fb_cmap *cmap, int kspc, int con, int fbidx);
-static int offb_set_cmap(struct fb_cmap *cmap, int kspc, int con, int fbidx);
+unsigned long offb_init(unsigned long mem_start);
+void offb_setup(char *options, int *ints);
+
+static int offb_open(struct fb_info *info);
+static int offb_release(struct fb_info *info);
+static int offb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			struct fb_info *info);
+static int offb_get_var(struct fb_var_screeninfo *var, int con,
+			struct fb_info *info);
+static int offb_set_var(struct fb_var_screeninfo *var, int con,
+			struct fb_info *info);
+static int offb_pan_display(struct fb_var_screeninfo *var, int con,
+			struct fb_info *info);
+static int offb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			struct fb_info *info);
+static int offb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			struct fb_info *info);
 static int offb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-			    u_long arg, int con, int fbidx);
+			    u_long arg, int con, struct fb_info *info);
+
+#ifdef CONFIG_FB_COMPAT_XPMAC
+int console_getmode(struct vc_mode *);
+int console_setmode(struct vc_mode *, int);
+int console_powermode(int);
+int (*console_setmode_ptr)(struct vc_mode *, int) = NULL;
+struct vc_mode display_info;
+#endif /* CONFIG_FB_COMPAT_XPMAC */
 
 
     /*
      *  Interface to the low level console driver
      */
 
-unsigned long offb_init(unsigned long mem_start);
-static int offbcon_switch(int con);
-static int offbcon_updatevar(int con);
-static void offbcon_blank(int blank);
+static int offbcon_switch(int con, struct fb_info *info);
+static int offbcon_updatevar(int con, struct fb_info *info);
+static void offbcon_blank(int blank, struct fb_info *info);
 
 
     /*
@@ -83,10 +103,10 @@
      */
 
 static int offb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
-                         u_int *transp);
+			 u_int *transp, struct fb_info *info);
 static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-                         u_int transp);
-static void do_install_cmap(int con);
+			 u_int transp, struct fb_info *info);
+static void do_install_cmap(int con, struct fb_info *info);
 
 
 static struct fb_ops offb_ops = {
@@ -99,20 +119,20 @@
      *  Open/Release the frame buffer device
      */
 
-static int offb_open(int fbidx)                                       
+static int offb_open(struct fb_info *info)
 {
-    /*                                                                     
-     *  Nothing, only a usage count for the moment                          
-     */                                                                    
+    /*
+     *  Nothing, only a usage count for the moment
+     */
 
     MOD_INC_USE_COUNT;
-    return(0);                              
+    return(0);
 }
-        
-static int offb_release(int fbidx)
+
+static int offb_release(struct fb_info *info)
 {
     MOD_DEC_USE_COUNT;
-    return(0);                                                    
+    return(0);
 }
 
 
@@ -120,9 +140,12 @@
      *  Get the Fixed Part of the Display
      */
 
-static int offb_get_fix(struct fb_fix_screeninfo *fix, int con, int fbidx)
+static int offb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			struct fb_info *info)
 {
-    memcpy(fix, &fb_fix[fbidx2dpy[fbidx]], sizeof(fb_fix[0]));
+    struct fb_info_offb *info2 = (struct fb_info_offb *)info;
+
+    memcpy(fix, &info2->fix, sizeof(struct fb_fix_screeninfo));
     return 0;
 }
 
@@ -131,9 +154,12 @@
      *  Get the User Defined Part of the Display
      */
 
-static int offb_get_var(struct fb_var_screeninfo *var, int con, int fbidx)
+static int offb_get_var(struct fb_var_screeninfo *var, int con,
+			struct fb_info *info)
 {
-    memcpy(var, &fb_var[fbidx2dpy[fbidx]], sizeof(fb_var[0]));
+    struct fb_info_offb *info2 = (struct fb_info_offb *)info;
+
+    memcpy(var, &info2->var, sizeof(struct fb_var_screeninfo));
     return 0;
 }
 
@@ -142,34 +168,36 @@
      *  Set the User Defined Part of the Display
      */
 
-static int offb_set_var(struct fb_var_screeninfo *var, int con, int fbidx)
+static int offb_set_var(struct fb_var_screeninfo *var, int con,
+			struct fb_info *info)
 {
     struct display *display;
     int oldbpp = -1, err;
-    int dpy = fbidx2dpy[fbidx];
+    int activate = var->activate;
+    struct fb_info_offb *info2 = (struct fb_info_offb *)info;
 
     if (con >= 0)
 	display = &fb_display[con];
     else
-	display = &fb_disp[dpy];	/* used during initialization */
+	display = &info2->disp;	/* used during initialization */
 
-    if (var->xres > fb_var[dpy].xres || var->yres > fb_var[dpy].yres ||
-	var->xres_virtual > fb_var[dpy].xres_virtual ||
-	var->yres_virtual > fb_var[dpy].yres_virtual ||
-	var->bits_per_pixel > fb_var[dpy].bits_per_pixel ||
+    if (var->xres > info2->var.xres || var->yres > info2->var.yres ||
+	var->xres_virtual > info2->var.xres_virtual ||
+	var->yres_virtual > info2->var.yres_virtual ||
+	var->bits_per_pixel > info2->var.bits_per_pixel ||
 	var->nonstd ||
 	(var->vmode & FB_VMODE_MASK) != FB_VMODE_NONINTERLACED)
 	return -EINVAL;
-    memcpy(var, &fb_var[dpy], sizeof(fb_var[dpy]));
+    memcpy(var, &info2->var, sizeof(struct fb_var_screeninfo));
 
-    if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
+    if ((activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
 	oldbpp = display->var.bits_per_pixel;
 	display->var = *var;
     }
     if (oldbpp != var->bits_per_pixel) {
 	if ((err = fb_alloc_cmap(&display->cmap, 0, 0)))
 	    return err;
-	do_install_cmap(con);
+	do_install_cmap(con, info);
     }
     return 0;
 }
@@ -181,7 +209,8 @@
      *  This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
      */
 
-static int offb_pan_display(struct fb_var_screeninfo *var, int con, int fbidx)
+static int offb_pan_display(struct fb_var_screeninfo *var, int con,
+			    struct fb_info *info)
 {
     if (var->xoffset || var->yoffset)
 	return -EINVAL;
@@ -193,14 +222,16 @@
      *  Get the Colormap
      */
 
-static int offb_get_cmap(struct fb_cmap *cmap, int kspc, int con, int fbidx)
+static int offb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			 struct fb_info *info)
 {
     if (con == currcon) /* current console? */
-	return fb_get_cmap(cmap, &fb_display[con].var, kspc, offb_getcolreg);
+	return fb_get_cmap(cmap, &fb_display[con].var, kspc, offb_getcolreg,
+			   info);
     else if (fb_display[con].cmap.len) /* non default colormap? */
 	fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
     else
-	fb_copy_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
+	fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
 		     cmap, kspc ? 0 : 2);
     return 0;
 }
@@ -209,11 +240,13 @@
      *  Set the Colormap
      */
 
-static int offb_set_cmap(struct fb_cmap *cmap, int kspc, int con, int fbidx)
+static int offb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			 struct fb_info *info)
 {
+    struct fb_info_offb *info2 = (struct fb_info_offb *)info;
     int err;
 
-    if (!unknown_cmap_adr)
+    if (!info2->cmap_adr)
 	return -ENOSYS;
 
     if (!fb_display[con].cmap.len) {	/* no colormap allocated? */
@@ -222,7 +255,8 @@
 	    return err;
     }
     if (con == currcon)			/* current console? */
-	return fb_set_cmap(cmap, &fb_display[con].var, kspc, offb_setcolreg);
+	return fb_set_cmap(cmap, &fb_display[con].var, kspc, offb_setcolreg,
+			   info);
     else
 	fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
     return 0;
@@ -230,17 +264,20 @@
 
 
 static int offb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-		      u_long arg, int con, int fbidx)
+		      u_long arg, int con, struct fb_info *info)
 {
     return -EINVAL;
 }
 
 
 #ifdef CONFIG_FB_ATY
+extern unsigned long atyfb_of_init(unsigned long mem_start,
+				   struct device_node *dp);
+
 static const char *aty_names[] = {
-        "ATY,mach64", "ATY,XCLAIM", "ATY,264VT", "ATY,mach64ii", "ATY,264GT-B", 
-        "ATY,mach64_3D_pcc", "ATY,XCLAIM3D", "ATY,XCLAIMVR", "ATY,RAGEII_M"
-}
+    "ATY,mach64", "ATY,XCLAIM", "ATY,264VT", "ATY,mach64ii", "ATY,264GT-B", 
+    "ATY,mach64_3D_pcc", "ATY,XCLAIM3D", "ATY,XCLAIMVR", "ATY,RAGEII_M"
+};
 #endif /* CONFIG_FB_ATY */
 
 
@@ -256,28 +293,30 @@
     struct fb_fix_screeninfo *fix;
     struct fb_var_screeninfo *var;
     struct display *disp;
-    struct fb_info *info;
+    struct fb_info_offb *info;
 
     for (dpy = 0; dpy < prom_num_displays; dpy++) {
 	if (!(dp = find_path_device(prom_display_paths[dpy])))
 	    continue;
 
-	fix = &fb_fix[dpy];
-	var = &fb_var[dpy];
-	disp = &fb_disp[dpy];
 	info = &fb_info[dpy];
+	fix = &info->fix;
+	var = &info->var;
+	disp = &info->disp;
 
+	if (!ofonly) {
 #ifdef CONFIG_FB_ATY
-	printk("offb: dp->name = %s\n", dp->name);
-	for (i = 0; i < sizeof(aty_names)/sizeof(*aty_names); i++)
-	    if (!strcmp(dp->name, aty_names[i])) {
-		printk("offb: calling atyfb\n");
+	    for (i = 0; i < sizeof(aty_names)/sizeof(*aty_names); i++)
+		if (!strcmp(dp->name, aty_names[i]))
+		    break;
+	    if (i < sizeof(aty_names)/sizeof(*aty_names)) {
 		mem_start = atyfb_of_init(mem_start, dp);
-		goto skip_offb;
+		continue;
 	    }
-	printk("offb: no better driver available\n");
 #endif /* CONFIG_FB_ATY */
+	}
 
+	strcpy(fix->id, "OFfb ");
 	strncat(fix->id, dp->name, sizeof(fix->id));
 	fix->id[sizeof(fix->id)-1] = '\0';
 
@@ -317,12 +356,33 @@
 
 	/* XXX kludge for ati */
 	if (strncmp(dp->name, "ATY,", 4) == 0) {
-	    unknown_cmap_adr = ioremap(address + 0x7ff000, 0x1000) + 0xcc0;
-	    unknown_cmap_data = unknown_cmap_adr + 1;
+	    info->cmap_adr = ioremap(address + 0x7ff000, 0x1000) + 0xcc0;
+	    info->cmap_data = info->cmap_adr + 1;
 	}
 
-	fix->visual = unknown_cmap_adr ? FB_VISUAL_PSEUDOCOLOR :
-					   FB_VISUAL_STATIC_PSEUDOCOLOR;
+#ifdef CONFIG_FB_COMPAT_XPMAC
+	if (display_info.height == 0) {	/* Only the first display */
+	    display_info.height = var->yres;
+	    display_info.width = var->xres;
+	    display_info.depth = 8;
+	    display_info.pitch = fix->line_length;
+	    display_info.mode = 0;
+	    strncpy(display_info.name, dp->name, sizeof(display_info.name));
+	    display_info.fb_address = (unsigned long)fix->smem_start;
+	    display_info.cmap_adr_address = 0;
+	    display_info.cmap_data_address = 0;
+	    display_info.disp_reg_address = 0;
+	    /* XXX kludge for ati */
+	    if (strncmp(dp->name, "ATY,", 4) == 0) {
+		    display_info.disp_reg_address = address + 0x7ffc00;
+		    display_info.cmap_adr_address = address + 0x7ffcc0;
+		    display_info.cmap_data_address = address + 0x7ffcc1;
+	    }
+	}
+#endif /* CONFIG_FB_COMPAT_XPMAC) */
+
+	fix->visual = info->cmap_adr ? FB_VISUAL_PSEUDOCOLOR :
+				       FB_VISUAL_STATIC_PSEUDOCOLOR;
 
 	var->xoffset = var->yoffset = 0;
 	var->bits_per_pixel = 8;
@@ -353,50 +413,63 @@
 	disp->ypanstep = 0;
 	disp->ywrapstep = 0;
 	disp->line_length = fix->line_length;
-	disp->can_soft_blank = unknown_cmap_adr ? 1 : 0;
+	disp->can_soft_blank = info->cmap_adr ? 1 : 0;
 	disp->inverse = 0;
 
-	strcpy(info->modename, "OFfb ");
-	strncat(info->modename, dp->full_name, sizeof(info->modename));
-	info->node = -1;
-	info->fbops = &offb_ops;
-	info->disp = disp;
-	info->fontname[0] = '\0';
-	info->changevar = NULL;
-	info->switch_con = &offbcon_switch;
-	info->updatevar = &offbcon_updatevar;
-	info->blank = &offbcon_blank;
+	strcpy(info->info.modename, "OFfb ");
+	strncat(info->info.modename, dp->full_name,
+		sizeof(info->info.modename));
+	info->info.node = -1;
+	info->info.fbops = &offb_ops;
+	info->info.disp = disp;
+	info->info.fontname[0] = '\0';
+	info->info.changevar = NULL;
+	info->info.switch_con = &offbcon_switch;
+	info->info.updatevar = &offbcon_updatevar;
+	info->info.blank = &offbcon_blank;
 
-	err = register_framebuffer(info);
+	err = register_framebuffer(&info->info);
 	if (err < 0)
 	    continue;
 
 	for (i = 0; i < 16; i++) {
 	    int j = color_table[i];
-	    palette[dpy][i].red = default_red[j];
-	    palette[dpy][i].green = default_grn[j];
-	    palette[dpy][i].blue = default_blu[j];
+	    info->palette[i].red = default_red[j];
+	    info->palette[i].green = default_grn[j];
+	    info->palette[i].blue = default_blu[j];
 	}
-	offb_set_var(var, -1, GET_FB_IDX(info->node));
-	fbidx2dpy[GET_FB_IDX(info->node)] = dpy;
+	offb_set_var(var, -1, &info->info);
 
 	printk("Open Firmware frame buffer device on %s\n", dp->full_name);
-skip_offb:
     }
     return mem_start;
 }
 
 
-static int offbcon_switch(int con)
+    /*
+     *  Setup: parse used options
+     */
+
+void offb_setup(char *options, int *ints)
+{
+    if (!options || !*options)
+	return;
+
+    if (!strcmp(options, "ofonly"))
+	ofonly = 1;
+}
+
+
+static int offbcon_switch(int con, struct fb_info *info)
 {
     /* Do we have to save the colormap? */
     if (fb_display[currcon].cmap.len)
 	fb_get_cmap(&fb_display[currcon].cmap, &fb_display[currcon].var, 1,
-		    offb_getcolreg);
+		    offb_getcolreg, info);
 
     currcon = con;
     /* Install new colormap */
-    do_install_cmap(con);
+    do_install_cmap(con, info);
     return 0;
 }
 
@@ -404,7 +477,7 @@
      *  Update the `var' structure (called by fbcon.c)
      */
 
-static int offbcon_updatevar(int con)
+static int offbcon_updatevar(int con, struct fb_info *info)
 {
     /* Nothing */
     return 0;
@@ -414,24 +487,25 @@
      *  Blank the display.
      */
 
-static void offbcon_blank(int blank)
+static void offbcon_blank(int blank, struct fb_info *info)
 {
+    struct fb_info_offb *info2 = (struct fb_info_offb *)info;
     int i, j;
 
-    if (!unknown_cmap_adr)
+    if (!info2->cmap_adr)
 	return;
 
     if (blank)
 	for (i = 0; i < 256; i++) {
-	    *unknown_cmap_adr = i;
+	    *info2->cmap_adr = i;
 	    mach_eieio();
 	    for (j = 0; j < 3; j++) {
-		*unknown_cmap_data = 0;
+		*info2->cmap_data = 0;
 		mach_eieio();
 	    }
 	}
     else
-	do_install_cmap(currcon);
+	do_install_cmap(currcon, info);
 }
 
     /*
@@ -440,15 +514,15 @@
      */
 
 static int offb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
-                         u_int *transp)
+			  u_int *transp, struct fb_info *info)
 {
-    unsigned int dpy = fbidx2dpy[0];
+    struct fb_info_offb *info2 = (struct fb_info_offb *)info;
 
-    if (!unknown_cmap_adr || regno > 255)
+    if (!info2->cmap_adr || regno > 255)
 	return 1;
-    *red = palette[dpy][regno].red;
-    *green = palette[dpy][regno].green;
-    *blue = palette[dpy][regno].blue;
+    *red = info2->palette[regno].red;
+    *green = info2->palette[regno].green;
+    *blue = info2->palette[regno].blue;
     return 0;
 }
 
@@ -460,35 +534,71 @@
      */
 
 static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-                         u_int transp)
+			 u_int transp, struct fb_info *info)
 {
-    unsigned int dpy = fbidx2dpy[0];
+    struct fb_info_offb *info2 = (struct fb_info_offb *)info;
 
-    if (!unknown_cmap_adr || regno > 255)
+    if (!info2->cmap_adr || regno > 255)
 	return 1;
-    palette[dpy][regno].red = red;
-    palette[dpy][regno].green = green;
-    palette[dpy][regno].blue = blue;
-    *unknown_cmap_adr = regno;
+    info2->palette[regno].red = red;
+    info2->palette[regno].green = green;
+    info2->palette[regno].blue = blue;
+    *info2->cmap_adr = regno;
     mach_eieio();
-    *unknown_cmap_data = red;
+    *info2->cmap_data = red;
     mach_eieio();
-    *unknown_cmap_data = green;
+    *info2->cmap_data = green;
     mach_eieio();
-    *unknown_cmap_data = blue;
+    *info2->cmap_data = blue;
     mach_eieio();
     return 0;
 }
 
 
-static void do_install_cmap(int con)
+static void do_install_cmap(int con, struct fb_info *info)
 {
     if (con != currcon)
 	return;
     if (fb_display[con].cmap.len)
 	fb_set_cmap(&fb_display[con].cmap, &fb_display[con].var, 1,
-		    offb_setcolreg);
+		    offb_setcolreg, info);
     else
-	fb_set_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
-				    &fb_display[con].var, 1, offb_setcolreg);
+	fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
+				    &fb_display[con].var, 1, offb_setcolreg,
+				    info);
+}
+
+
+#ifdef CONFIG_FB_COMPAT_XPMAC
+
+    /*
+     *  Backward compatibility mode for Xpmac
+     */
+
+int console_getmode(struct vc_mode *mode)
+{
+    *mode = display_info;
+    return 0;
+}
+
+int console_setmode(struct vc_mode *mode, int doit)
+{
+    int err;
+
+    if (console_setmode_ptr == NULL)
+	return -EINVAL;
+    err = (*console_setmode_ptr)(mode, doit);
+    return err;
 }
+
+int console_powermode(int mode)
+{
+    if (mode == VC_POWERMODE_INQUIRY)
+	return 0;
+    if (mode < VESA_NO_BLANKING || mode > VESA_POWERDOWN)
+	return -EINVAL;
+    /* Not supported */
+    return -ENXIO;
+}
+
+#endif /* CONFIG_FB_COMPAT_XPMAC */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/retz3fb.c m68k-2.1.72/drivers/video/retz3fb.c
--- m68k-2.1.72-status/drivers/video/retz3fb.c	Wed Dec 17 23:55:41 1997
+++ m68k-2.1.72/drivers/video/retz3fb.c	Thu Jan  8 00:07:28 1998
@@ -118,9 +118,11 @@
    int (*decode_var)(struct fb_var_screeninfo *var, struct retz3fb_par *par);
    int (*encode_var)(struct fb_var_screeninfo *var, struct retz3fb_par *par);
    int (*getcolreg)(unsigned int regno, unsigned int *red, unsigned
-		    int *green, unsigned int *blue, unsigned int *transp);
+		    int *green, unsigned int *blue, unsigned int *transp,
+			struct fb_info *info);
    int (*setcolreg)(unsigned int regno, unsigned int red, unsigned int
-		    green, unsigned int blue, unsigned int transp);
+		    green, unsigned int blue, unsigned int transp,
+			struct fb_info *info);
    void (*blank)(int blank);
 } *fbhw;
 
@@ -248,20 +250,23 @@
 
 void retz3fb_setup(char *options, int *ints);
 
-static int retz3fb_open(int fbidx);
-static int retz3fb_release(int fbidx);
-static int retz3fb_get_fix(struct fb_fix_screeninfo *fix, int con, int fbidx);
-static int retz3fb_get_var(struct fb_var_screeninfo *var, int con, int fbidx);
-static int retz3fb_set_var(struct fb_var_screeninfo *var, int con, int fbidx);
+static int retz3fb_open(struct fb_info *info);
+static int retz3fb_release(struct fb_info *info);
+static int retz3fb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			   struct fb_info *info);
+static int retz3fb_get_var(struct fb_var_screeninfo *var, int con,
+			   struct fb_info *info);
+static int retz3fb_set_var(struct fb_var_screeninfo *var, int con,
+			   struct fb_info *info);
 static int retz3fb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
-			     int fbidx);
+			    struct fb_info *info);
 static int retz3fb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
-			     int fbidx);
+			    struct fb_info *info);
 static int retz3fb_pan_display(struct fb_var_screeninfo *var, int con,
-				int fbidx);
+			       struct fb_info *info);
 static int retz3fb_ioctl(struct inode *inode, struct file *file,
-			  unsigned int cmd, unsigned long arg, int con,
-			  int fbidx);
+			 unsigned int cmd, unsigned long arg, int con,
+			 struct fb_info *info);
 
 
 /*
@@ -269,9 +274,9 @@
  */
 
 unsigned long retz3fb_init(unsigned long mem_start);
-static int z3fb_switch(int con);
-static int z3fb_updatevar(int con);
-static void z3fb_blank(int blank);
+static int z3fb_switch(int con, struct fb_info *info);
+static int z3fb_updatevar(int con, struct fb_info *info);
+static void z3fb_blank(int blank, struct fb_info *info);
 
 
 /*
@@ -300,10 +305,10 @@
                           struct retz3fb_par *par);
 static int retz3_getcolreg(unsigned int regno, unsigned int *red,
 			   unsigned int *green, unsigned int *blue,
-			   unsigned int *transp);
+			   unsigned int *transp, struct fb_info *info);
 static int retz3_setcolreg(unsigned int regno, unsigned int red,
 			   unsigned int green, unsigned int blue,
-			   unsigned int transp);
+			   unsigned int transp, struct fb_info *info);
 static void retz3_blank(int blank);
 
 
@@ -314,9 +319,9 @@
 static void retz3fb_get_par(struct retz3fb_par *par);
 static void retz3fb_set_par(struct retz3fb_par *par);
 static int do_fb_set_var(struct fb_var_screeninfo *var, int isactive);
-static void do_install_cmap(int con);
+static void do_install_cmap(int con, struct fb_info *info);
 /*
-static void retz3fb_set_disp(int con);
+static void retz3fb_set_disp(int con, struct fb_info *info);
 */
 static int get_video_mode(const char *name);
 
@@ -798,8 +803,8 @@
 	}
 #endif
 
-	retz3_setcolreg (255, 56, 100, 160, 0);
-	retz3_setcolreg (254, 0, 0, 0, 0);
+	retz3_setcolreg (255, 56, 100, 160, 0, NULL /* unused */);
+	retz3_setcolreg (254, 0, 0, 0, 0, NULL /* unused */);
 
 	return 0;
 }
@@ -931,7 +936,7 @@
 
 static int retz3_setcolreg(unsigned int regno, unsigned int red,
 			   unsigned int green, unsigned int blue,
-			   unsigned int transp)
+			   unsigned int transp, struct fb_info *info)
 {
 	/* We'll get to this */
 
@@ -959,7 +964,7 @@
 
 static int retz3_getcolreg(unsigned int regno, unsigned int *red,
 			   unsigned int *green, unsigned int *blue,
-			   unsigned int *transp)
+			   unsigned int *transp, struct fb_info *info)
 {
 	if (regno > 255)
 		return 1;
@@ -1171,17 +1176,17 @@
 }
 
 
-static void do_install_cmap(int con)
+static void do_install_cmap(int con, struct fb_info *info)
 {
 	if (con != currcon)
 		return;
 	if (fb_display[con].cmap.len)
 		fb_set_cmap(&fb_display[con].cmap, &fb_display[con].var, 1,
-			    fbhw->setcolreg);
+			    fbhw->setcolreg, info);
 	else
-		fb_set_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
+		fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
 					    &fb_display[con].var, 1,
-					    fbhw->setcolreg);
+					    fbhw->setcolreg, info);
 }
 
 
@@ -1189,7 +1194,7 @@
  *    Open/Release the frame buffer device
  */
 
-static int retz3fb_open(int fbidx)
+static int retz3fb_open(struct fb_info *info)
 {
 	/*
 	 * Nothing, only a usage count for the moment
@@ -1199,7 +1204,7 @@
 	return 0;
 }
 
-static int retz3fb_release(int fbidx)
+static int retz3fb_release(struct fb_info *info)
 {
 	MOD_DEC_USE_COUNT;
 	return 0;
@@ -1210,7 +1215,8 @@
  *    Get the Fixed Part of the Display
  */
 
-static int retz3fb_get_fix(struct fb_fix_screeninfo *fix, int con, int fbidx)
+static int retz3fb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			   struct fb_info *info)
 {
 	struct retz3fb_par par;
 	int error = 0;
@@ -1227,7 +1233,8 @@
  *    Get the User Defined Part of the Display
  */
 
-static int retz3fb_get_var(struct fb_var_screeninfo *var, int con, int fbidx)
+static int retz3fb_get_var(struct fb_var_screeninfo *var, int con,
+			   struct fb_info *info)
 {
 	struct retz3fb_par par;
 	int error = 0;
@@ -1242,7 +1249,7 @@
 
 
 #if 1
-static void retz3fb_set_disp(int con)
+static void retz3fb_set_disp(int con, struct fb_info *info)
 {
 	struct fb_fix_screeninfo fix;
 	struct display *display;
@@ -1252,8 +1259,7 @@
 	else
 		display = &disp;	/* used during initialization */
 
-	/* ### FN: Needs fixes later */
-	retz3fb_get_fix(&fix, con, 0);
+	retz3fb_get_fix(&fix, con, info);
 
 	if (con == -1)
 		con = 0;
@@ -1273,7 +1279,8 @@
  *    Set the User Defined Part of the Display
  */
 
-static int retz3fb_set_var(struct fb_var_screeninfo *var, int con, int fbidx)
+static int retz3fb_set_var(struct fb_var_screeninfo *var, int con,
+			   struct fb_info *info)
 {
 	int err, oldxres, oldyres, oldvxres, oldvyres, oldbpp;
 	struct display *display;
@@ -1304,7 +1311,7 @@
 		    oldbpp != var->bits_per_pixel) {
 
 			struct fb_fix_screeninfo fix;
-			retz3fb_get_fix(&fix, con, fbidx);
+			retz3fb_get_fix(&fix, con, info);
 
 			display->screen_base = fix.smem_start;
 			display->visual = fix.visual;
@@ -1316,7 +1323,7 @@
 			display->can_soft_blank = 1;
 			display->inverse = z3fb_inverse;
 /*
-	retz3fb_set_disp(con);
+	retz3fb_set_disp(con, info);
 */
 			if (fb_info.changevar)
 				(*fb_info.changevar)(con);
@@ -1325,7 +1332,7 @@
 		if (oldbpp != var->bits_per_pixel) {
 			if ((err = fb_alloc_cmap(&display->cmap, 0, 0)))
 				return err;
-			do_install_cmap(con);
+			do_install_cmap(con, info);
 		}
 	}
 	return 0;
@@ -1337,15 +1344,15 @@
  */
 
 static int retz3fb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
-			     int fbidx)
+			    struct fb_info *info)
 {
 	if (con == currcon) /* current console? */
 		return(fb_get_cmap(cmap, &fb_display[con].var, kspc,
-				   fbhw->getcolreg));
+				   fbhw->getcolreg, info));
 	else if (fb_display[con].cmap.len) /* non default colormap? */
 		fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
 	else
-		fb_copy_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
+		fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
 			     cmap, kspc ? 0 : 2);
 	return 0;
 }
@@ -1356,7 +1363,7 @@
  */
 
 static int retz3fb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
-			     int fbidx)
+			    struct fb_info *info)
 {
 	int err;
 
@@ -1368,7 +1375,7 @@
 	}
 	if (con == currcon)              /* current console? */
 		return(fb_set_cmap(cmap, &fb_display[con].var, kspc,
-				   fbhw->setcolreg));
+				   fbhw->setcolreg, info));
 	else
 		fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
 	return 0;
@@ -1382,7 +1389,7 @@
  */
 
 static int retz3fb_pan_display(struct fb_var_screeninfo *var, int con,
-				int fbidx)
+				struct fb_info *info)
 {
 	return -EINVAL;
 }
@@ -1393,8 +1400,8 @@
  */
 
 static int retz3fb_ioctl(struct inode *inode, struct file *file,
-                          unsigned int cmd, unsigned long arg, int con,
-                          int fbidx)
+                         unsigned int cmd, unsigned long arg, int con,
+                         struct fb_info *info)
 {
 	return -EINVAL;
 }
@@ -1486,11 +1493,11 @@
 	fbhw->encode_var(&retz3fb_default, &par);
 
 	do_fb_set_var(&retz3fb_default, 0);
-	retz3fb_get_var(&disp.var, -1, GET_FB_IDX(fb_info.node));
+	retz3fb_get_var(&disp.var, -1, &fb_info);
 
-	retz3fb_set_disp(-1);
+	retz3fb_set_disp(-1, &fb_info);
 
-	do_install_cmap(0);
+	do_install_cmap(0, &fb_info);
 
 	printk("%s frame buffer device, using %ldK of video memory\n",
 	       fb_info.modename, z3_size>>10);
@@ -1502,17 +1509,18 @@
 }
 
 
-static int z3fb_switch(int con)
+static int z3fb_switch(int con, struct fb_info *info)
 {
 	/* Do we have to save the colormap? */
 	if (fb_display[currcon].cmap.len)
 		fb_get_cmap(&fb_display[currcon].cmap,
-			    &fb_display[currcon].var, 1, fbhw->getcolreg);
+			    &fb_display[currcon].var, 1, fbhw->getcolreg,
+			    info);
 
 	do_fb_set_var(&fb_display[con].var, 1);
 	currcon = con;
 	/* Install new colormap */
-	do_install_cmap(con);
+	do_install_cmap(con, info);
 	return 0;
 }
 
@@ -1524,7 +1532,7 @@
  *    Since it's called by a kernel driver, no range checking is done.
  */
 
-static int z3fb_updatevar(int con)
+static int z3fb_updatevar(int con, struct fb_info *info)
 {
 	return 0;
 }
@@ -1534,7 +1542,7 @@
  *    Blank the display.
  */
 
-static void z3fb_blank(int blank)
+static void z3fb_blank(int blank, struct fb_info *info)
 {
 	fbhw->blank(blank);
 }
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/skeletonfb.c m68k-2.1.72/drivers/video/skeletonfb.c
--- m68k-2.1.72-status/drivers/video/skeletonfb.c	Thu Jan  1 01:00:00 1970
+++ m68k-2.1.72/drivers/video/skeletonfb.c	Wed Jan  7 22:03:28 1998
@@ -0,0 +1,263 @@
+/*
+ * linux/drivers/video/skeletonfb.c -- Skeleton for a frame buffer device
+ *
+ *  Created 28 Dec 1997 by Geert Uytterhoeven
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file README.legal in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/tty.h>
+#include <linux/malloc.h>
+#include <linux/delay.h>
+
+
+    /*
+     *  This is just simple example code.
+     *
+     *  No warranty that it actually compiles.
+     *  Even less warranty that it actually works.
+     */
+
+
+static int default_par = 0;	/* default resolution (0=none) */
+
+static struct xxxfb_info {
+    struct fb_info_gen gen;
+    /* Here starts the frame buffer device dependent part */
+    /* You can use this to store e.g. the board number if you support */
+    /* multiple boards */
+} fb_info;
+
+static int currcon = 0;
+
+static struct display disp;
+
+static struct xxxfb_par {
+    ...
+} current_par;
+
+static int current_par_valid = 0;
+
+
+int inverse = 0;
+
+
+/* ------------------- chipset specific functions ---------------------- */
+
+
+static int xxx_detect(void)
+{
+    ...
+    xxx_get_par(&par);
+    xxx_encode_var(&xxxfb_predefined[0], &par);
+    return 1;
+}
+
+static int xxx_encode_fix(struct fb_fix_screeninfo *fix, struct xxxfb_par *par,
+			  const struct fb_info *fb_info)
+{
+    ...
+    return 0;
+}
+
+static int xxx_decode_var(struct fb_var_screeninfo *var, struct xxxfb_par *par,
+			  const struct fb_info *fb_info)
+{
+    ...
+    return 0;
+}
+
+static int xxx_encode_var(struct fb_var_screeninfo *var, struct xxxfb_par *par,
+			  const struct fb_info *fb_info)
+{
+    ...
+    return 0;
+}
+
+static void xxx_get_par(struct xxxfb_par *par, const struct fb_info *fb_info)
+{
+    if (current_par_valid)
+	*par = current_par;
+    else {
+	...
+    }
+}
+
+static void xxx_set_par(struct xxxfb_par *par, const struct fb_info *fb_info)
+{
+    current_par = *par;
+    current_par_valid = 1;
+    ...
+}
+
+static int xxx_getcolreg(unsigned regno, unsigned *red, unsigned *green,
+			 unsigned *blue, unsigned *transp,
+			 const struct fb_info *fb_info)
+{
+    ...
+    return 0;
+}
+
+/* make colors available to fbcon */
+unsigned u16 packed16_cmap[16];
+unsigned u32 packed24_cmap[16];
+unsigned u32 packed32_cmap[16];
+
+static int xxx_setcolreg(unsigned regno, unsigned red, unsigned green,
+			 unsigned blue, unsigned transp,
+			 const struct fb_info *fb_info)
+{
+    ...
+    if (regno < 16) {
+	if (is_cfb15)		/* RGB 555 */
+	    packed16_cmap[regno] = be16_to_cpu((red << 10) | (green << 5) |
+					       blue);
+	if (is_cfb16)		/* RGB 565 */
+	    packed16_cmap[regno] = be16_to_cpu((red << 11) | (green << 5) |
+					       blue);
+	if (is_cfb24)		/* RGB 888 */
+	    packed24_cmap[regno] = be32_to_cpu((red << 16) | (green << 8) |
+					       blue);
+	if (is_cfb32)		/* RGBA 8888 */
+	    packed32_cmap[regno] = be32_to_cpu((red << 24) | (green << 16) |
+					       (blue << 8) | transp);
+    }
+    return 0;
+}
+
+static int xxx_pan_display(struct fb_var_screeninfo *var,
+			   struct xxxfb_par *par,
+			   const struct fb_info *fb_info)
+{
+    ...
+    return 0;
+}
+
+static int xxx_blank(int blank_mode, const struct fb_info *fb_info)
+{
+    ...
+    return 0;
+}
+
+
+/* ------------ Interfaces to hardware functions ------------ */
+
+
+struct fbgen_hwswitch xxx_switch = {
+    xxx_detect, xxx_encode_fix, xxx_decode_var, xxx_encode_var, xxx_get_par,
+    xxx_set_par, xxx_getcolreg, xxx_setcolreg, xxx_blank
+};
+
+
+
+/* =========================================================== */
+/* ============== Hardware Independant Functions ============= */
+/* =========================================================== */
+
+
+/* ----------------------------------------------------------------------------
+
+    /*
+     *  Initialization
+     */
+
+__initfunc(unsigned long xxxfb_init(unsigned long mem_start))
+{
+    int err;
+    struct fb_var_screeninfo var;
+
+    fb_info.fbhw = &xxx_switch;
+    detected_mode = fbhw->detect();
+    strcpy(fb_info.modename, "XXX");
+    fb_info.changevar = NULL;
+    fb_info.node = -1;
+    fb_info.fbops = &xxxfb_ops;
+    fb_info.disp = disp;
+    fb_info.switch_con = &xxxfb_switch;
+    fb_info.updatevar = &xxxfb_update_var;
+    fb_info.blank = &xxxfb_blank;
+    /* This should give a reasonable default video mode */
+    xxxfb_get_var(&disp.var, -1, &fb_info);
+    fb_do_set_var(var, 1);
+    err = register_framebuffer(&fb_info);
+    if (err < 0)
+	return err;
+    xxxfb_set_disp(-1, &fb_info);
+    fb_install_cmap(0);
+    printk("%s frame buffer device\n", fb_info.modename);
+
+    /* uncomment this if your driver cannot be unloaded */
+    /* MOD_INC_USE_COUNT; */
+
+    return mem_start;
+}
+
+
+    /*
+     *  Setup
+     */
+
+__initfunc(void xxxfb_setup(char *options, int *ints))
+{
+    /* Parse user speficied options (`video=xxxfb:')
+}
+
+
+/* ----------------------------------------------------------------------------
+
+
+    /*
+     *  Frame buffer operations
+     */
+
+static int xxxfb_open(const struct fb_info *info)
+{
+    /* Nothing, only a usage count for the moment */
+    MOD_INC_USE_COUNT;
+    return 0;
+}
+
+static int xxxfb_release(const struct fb_info *info)
+{
+    MOD_DEC_USE_COUNT;
+    return 0;
+}
+
+
+    /*
+     *  In most cases the `generic' routines should be satisfactory
+     */
+
+static struct fb_ops xxxfb_ops = {
+    xxxfb_open, xxxfb_release, fbgen_get_fix, fbgen_get_var, fbgen_set_var,
+    fbgen_get_cmap, fbgen_set_cmap, fbgen_pan_display, fbgen_ioctl
+};
+
+
+/* ----------------------------------------------------------------------------
+
+
+    /*
+     *  Modularization
+     */
+
+#ifdef MODULE
+int init_module(void)
+{
+    return xxxfb_init(NULL);
+}
+
+void cleanup_module(void)
+{
+    /* Not reached because the usecount will never be decremented to zero */
+    unregister_framebuffer(&fb_info);
+    /* TODO: further clean up ... */
+}
+#endif /* MODULE */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/tgafb.c m68k-2.1.72/drivers/video/tgafb.c
--- m68k-2.1.72-status/drivers/video/tgafb.c	Wed Dec 17 23:56:55 1997
+++ m68k-2.1.72/drivers/video/tgafb.c	Thu Jan  8 00:10:04 1998
@@ -17,13 +17,12 @@
  *
  *	- How to set a single color register?
  *
- *	- We don't have support for CFB32 yet (fbcon-cfb32.c)
- *
  *	- Hardware cursor (useful for other graphics boards too)
  *
  * KNOWN PROBLEMS/TO DO ==================================================== */
 
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -243,6 +242,9 @@
 static struct fb_info fb_info;
 static struct { u_char red, green, blue, pad; } palette[256];
 
+/* hack to tell fbcon-cfb32 the colormap */
+extern u32 cfb32_cmap[16];
+
 static struct fb_fix_screeninfo fb_fix = { { "DEC TGA ", } };
 static struct fb_var_screeninfo fb_var = { 0, };
 
@@ -251,17 +253,22 @@
      *  Interface used by the world
      */
 
-static int tgafb_open(int fbidx);
-static int tgafb_release(int fbidx);
-static int tgafb_get_fix(struct fb_fix_screeninfo *fix, int con, int fbidx);
-static int tgafb_get_var(struct fb_var_screeninfo *var, int con, int fbidx);
-static int tgafb_set_var(struct fb_var_screeninfo *var, int con, int fbidx);
+static int tgafb_open(struct fb_info *info);
+static int tgafb_release(struct fb_info *info);
+static int tgafb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			 struct fb_info *info);
+static int tgafb_get_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info);
+static int tgafb_set_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info);
 static int tgafb_pan_display(struct fb_var_screeninfo *var, int con,
-			     int fbidx);
-static int tgafb_get_cmap(struct fb_cmap *cmap, int kspc, int con, int fbidx);
-static int tgafb_set_cmap(struct fb_cmap *cmap, int kspc, int con, int fbidx);
+			     struct fb_info *info);
+static int tgafb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info);
+static int tgafb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info);
 static int tgafb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-		       u_long arg, int con, int fbidx);
+		       u_long arg, int con, struct fb_info *info);
 
 
     /*
@@ -269,9 +276,9 @@
      */
 
 unsigned long tgafb_init(unsigned long mem_start);
-static int tgafbcon_switch(int con);
-static int tgafbcon_updatevar(int con);
-static void tgafbcon_blank(int blank);
+static int tgafbcon_switch(int con, struct fb_info *info);
+static int tgafbcon_updatevar(int con, struct fb_info *info);
+static void tgafbcon_blank(int blank, struct fb_info *info);
 
 
     /*
@@ -279,13 +286,13 @@
      */
 
 static int tgafb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
-			   u_int *transp);
+			   u_int *transp, struct fb_info *info);
 static int tgafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-			   u_int transp);
+			   u_int transp, struct fb_info *info);
 #if 1
 static void tga_update_palette(void);
 #endif
-static void do_install_cmap(int con);
+static void do_install_cmap(int con, struct fb_info *info);
 
 
 static struct fb_ops tgafb_ops = {
@@ -298,7 +305,7 @@
      *  Open/Release the frame buffer device
      */
 
-static int tgafb_open(int fbidx)                                       
+static int tgafb_open(struct fb_info *info)                                       
 {
     /*                                                                     
      *  Nothing, only a usage count for the moment                          
@@ -308,7 +315,7 @@
     return(0);                              
 }
         
-static int tgafb_release(int fbidx)
+static int tgafb_release(struct fb_info *info)
 {
     MOD_DEC_USE_COUNT;
     return(0);                                                    
@@ -319,7 +326,8 @@
      *  Get the Fixed Part of the Display
      */
 
-static int tgafb_get_fix(struct fb_fix_screeninfo *fix, int con, int fbidx)
+static int tgafb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			 struct fb_info *info)
 {
     memcpy(fix, &fb_fix, sizeof(fb_fix));
     return 0;
@@ -330,7 +338,8 @@
      *  Get the User Defined Part of the Display
      */
 
-static int tgafb_get_var(struct fb_var_screeninfo *var, int con, int fbidx)
+static int tgafb_get_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info)
 {
     memcpy(var, &fb_var, sizeof(fb_var));
     return 0;
@@ -341,7 +350,8 @@
      *  Set the User Defined Part of the Display
      */
 
-static int tgafb_set_var(struct fb_var_screeninfo *var, int con, int fbidx)
+static int tgafb_set_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info)
 {
     struct display *display;
     int oldbpp = -1, err;
@@ -367,7 +377,7 @@
     if (oldbpp != var->bits_per_pixel) {
 	if ((err = fb_alloc_cmap(&display->cmap, 0, 0)))
 	    return err;
-	do_install_cmap(con);
+	do_install_cmap(con, info);
     }
     return 0;
 }
@@ -379,7 +389,8 @@
      *  This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
      */
 
-static int tgafb_pan_display(struct fb_var_screeninfo *var, int con, int fbidx)
+static int tgafb_pan_display(struct fb_var_screeninfo *var, int con,
+			     struct fb_info *info)
 {
     if (var->xoffset || var->yoffset)
 	return -EINVAL;
@@ -391,14 +402,16 @@
      *  Get the Colormap
      */
 
-static int tgafb_get_cmap(struct fb_cmap *cmap, int kspc, int con, int fbidx)
+static int tgafb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info)
 {
     if (con == currcon) /* current console? */
-	return fb_get_cmap(cmap, &fb_display[con].var, kspc, tgafb_getcolreg);
+	return fb_get_cmap(cmap, &fb_display[con].var, kspc, tgafb_getcolreg,
+			   info);
     else if (fb_display[con].cmap.len) /* non default colormap? */
 	fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
     else
-	fb_copy_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
+	fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
 		     cmap, kspc ? 0 : 2);
     return 0;
 }
@@ -407,7 +420,8 @@
      *  Set the Colormap
      */
 
-static int tgafb_set_cmap(struct fb_cmap *cmap, int kspc, int con, int fbidx)
+static int tgafb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info)
 {
     int err;
 
@@ -417,7 +431,8 @@
 	    return err;
     }
     if (con == currcon) {		/* current console? */
-	err = fb_set_cmap(cmap, &fb_display[con].var, kspc, tgafb_setcolreg);
+	err = fb_set_cmap(cmap, &fb_display[con].var, kspc, tgafb_setcolreg,
+			  info);
 #if 1
 	tga_update_palette();
 #endif
@@ -429,7 +444,7 @@
 
 
 static int tgafb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-		       u_long arg, int con, int fbidx)
+		       u_long arg, int con, struct fb_info *info)
 {
     return -EINVAL;
 }
@@ -692,7 +707,16 @@
 
     fb_var.xoffset = fb_var.yoffset = 0;
     fb_var.grayscale = 0;
-    fb_var.red.offset = fb_var.green.offset = fb_var.blue.offset = 0;
+    if (tga_type == 0) { /* 8-plane */
+	fb_var.red.offset = 0;
+	fb_var.green.offset = 0;
+	fb_var.blue.offset = 0;
+    } else { /* 24-plane or 24plusZ */
+	/* XXX: is this correct?? */
+	fb_var.red.offset = 16;
+	fb_var.green.offset = 8;
+	fb_var.blue.offset = 0;
+    }
     fb_var.red.length = fb_var.green.length = fb_var.blue.length = 8;
     fb_var.red.msb_right = fb_var.green.msb_right = fb_var.blue.msb_right = 0;
     fb_var.transp.offset = fb_var.transp.length = fb_var.transp.msb_right = 0;
@@ -738,23 +762,23 @@
     if (err < 0)
 	return mem_start;
 
-    tgafb_set_var(&fb_var, -1, GET_FB_IDX(fb_info.node));
+    tgafb_set_var(&fb_var, -1, &fb_info);
 
     printk("%s frame buffer device\n", fb_fix.id);
     return mem_start;
 }
 
 
-static int tgafbcon_switch(int con)
+static int tgafbcon_switch(int con, struct fb_info *info)
 {
     /* Do we have to save the colormap? */
     if (fb_display[currcon].cmap.len)
 	fb_get_cmap(&fb_display[currcon].cmap, &fb_display[currcon].var, 1,
-		    tgafb_getcolreg);
+		    tgafb_getcolreg, info);
 
     currcon = con;
     /* Install new colormap */
-    do_install_cmap(con);
+    do_install_cmap(con, info);
     return 0;
 }
 
@@ -762,7 +786,7 @@
      *  Update the `var' structure (called by fbcon.c)
      */
 
-static int tgafbcon_updatevar(int con)
+static int tgafbcon_updatevar(int con, struct fb_info *info)
 {
     /* Nothing */
     return 0;
@@ -772,7 +796,7 @@
      *  Blank the display.
      */
 
-static void tgafbcon_blank(int blank)
+static void tgafbcon_blank(int blank, struct fb_info *info)
 {
     /* Nothing */
 }
@@ -783,7 +807,7 @@
      */
 
 static int tgafb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
-                         u_int *transp)
+                         u_int *transp, struct fb_info *info)
 {
     if (regno > 255)
 	return 1;
@@ -801,7 +825,7 @@
      */
 
 static int tgafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-                         u_int transp)
+                         u_int transp, struct fb_info *info)
 {
     if (regno > 255)
 	return 1;
@@ -809,6 +833,11 @@
     palette[regno].green = green;
     palette[regno].blue = blue;
 
+#ifdef CONFIG_FBCON_CFB32
+    if (regno < 16 && tga_type != 0)
+	cfb32_cmap[regno] = (red << 16) | (green << 8) | blue;
+#endif /* CONFIG_FBCON_CFB32 */
+
     /* How to set a single color register?? */
 
     return 0;
@@ -846,16 +875,17 @@
 }
 #endif
 
-static void do_install_cmap(int con)
+static void do_install_cmap(int con, struct fb_info *info)
 {
     if (con != currcon)
 	return;
     if (fb_display[con].cmap.len)
 	fb_set_cmap(&fb_display[con].cmap, &fb_display[con].var, 1,
-		    tgafb_setcolreg);
+		    tgafb_setcolreg, info);
     else
-	fb_set_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
-				    &fb_display[con].var, 1, tgafb_setcolreg);
+	fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
+				    &fb_display[con].var, 1, tgafb_setcolreg,
+				    info);
 #if 1
     tga_update_palette();
 #endif
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/vfb.c m68k-2.1.72/drivers/video/vfb.c
--- m68k-2.1.72-status/drivers/video/vfb.c	Wed Dec 17 23:55:41 1997
+++ m68k-2.1.72/drivers/video/vfb.c	Thu Jan  8 00:11:05 1998
@@ -58,22 +58,22 @@
 
 void vfb_setup(char *options, int *ints);
 
-static int vfb_open(int fbidx);
-static int vfb_release(int fbidx);
+static int vfb_open(struct fb_info *info);
+static int vfb_release(struct fb_info *info);
 static int vfb_get_fix(struct fb_fix_screeninfo *fix, int con,
-			      int fbidx);
+		       struct fb_info *info);
 static int vfb_get_var(struct fb_var_screeninfo *var, int con,
-			      int fbidx);
+		       struct fb_info *info);
 static int vfb_set_var(struct fb_var_screeninfo *var, int con,
-			      int fbidx);
+		       struct fb_info *info);
 static int vfb_pan_display(struct fb_var_screeninfo *var, int con,
-				  int fbidx);
+			   struct fb_info *info);
 static int vfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
-			       int fbidx);
+			struct fb_info *info);
 static int vfb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
-			       int fbidx);
+			struct fb_info *info);
 static int vfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-			    u_long arg, int con, int fbidx);
+		     u_long arg, int con, struct fb_info *info);
 
 
     /*
@@ -81,9 +81,9 @@
      */
 
 unsigned long vfb_init(unsigned long mem_start);
-static int vfbcon_switch(int con);
-static int vfbcon_updatevar(int con);
-static void vfbcon_blank(int blank);
+static int vfbcon_switch(int con, struct fb_info *info);
+static int vfbcon_updatevar(int con, struct fb_info *info);
+static void vfbcon_blank(int blank, struct fb_info *info);
 
 
     /*
@@ -95,10 +95,10 @@
 			   struct fb_var_screeninfo *var);
 static void set_color_bitfields(struct fb_var_screeninfo *var);
 static int vfb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
-                         u_int *transp);
+                         u_int *transp, struct fb_info *info);
 static int vfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-                         u_int transp);
-static void do_install_cmap(int con);
+                         u_int transp, struct fb_info *info);
+static void do_install_cmap(int con, struct fb_info *info);
 
 
 static struct fb_ops vfb_ops = {
@@ -112,7 +112,7 @@
      *  Open/Release the frame buffer device
      */
 
-static int vfb_open(int fbidx)                                       
+static int vfb_open(struct fb_info *info)                                       
 {
     /*                                                                     
      *  Nothing, only a usage count for the moment                          
@@ -122,7 +122,7 @@
     return(0);                              
 }
         
-static int vfb_release(int fbidx)
+static int vfb_release(struct fb_info *info)
 {
     MOD_DEC_USE_COUNT;
     return(0);                                                    
@@ -134,7 +134,7 @@
      */
 
 static int vfb_get_fix(struct fb_fix_screeninfo *fix, int con,
-			      int fbidx)
+		       struct fb_info *info)
 {
     struct fb_var_screeninfo *var;
 
@@ -152,7 +152,7 @@
      */
 
 static int vfb_get_var(struct fb_var_screeninfo *var, int con,
-			      int fbidx)
+		       struct fb_info *info)
 {
     if (con == -1)
 	*var = vfb_default;
@@ -168,7 +168,7 @@
      */
 
 static int vfb_set_var(struct fb_var_screeninfo *var, int con,
-			      int fbidx)
+		       struct fb_info *info)
 {
     int err, activate = var->activate;
     int oldxres, oldyres, oldvxres, oldvyres, oldbpp;
@@ -255,7 +255,7 @@
 	if (oldbpp != var->bits_per_pixel) {
 	    if ((err = fb_alloc_cmap(&display->cmap, 0, 0)))
 		return err;
-	    do_install_cmap(con);
+	    do_install_cmap(con, info);
 	}
     }
     return 0;
@@ -269,7 +269,7 @@
      */
 
 static int vfb_pan_display(struct fb_var_screeninfo *var, int con,
-				  int fbidx)
+			   struct fb_info *info)
 {
     if (var->vmode & FB_VMODE_YWRAP) {
 	if (var->yoffset < 0 ||
@@ -297,14 +297,15 @@
      */
 
 static int vfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
-			       int fbidx)
+			struct fb_info *info)
 {
     if (con == currcon) /* current console? */
-	return fb_get_cmap(cmap, &fb_display[con].var, kspc, vfb_getcolreg);
+	return fb_get_cmap(cmap, &fb_display[con].var, kspc, vfb_getcolreg,
+			   info);
     else if (fb_display[con].cmap.len) /* non default colormap? */
 	fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
     else
-	fb_copy_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
+	fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
 		     cmap, kspc ? 0 : 2);
     return 0;
 }
@@ -314,7 +315,7 @@
      */
 
 static int vfb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
-			       int fbidx)
+			struct fb_info *info)
 {
     int err;
 
@@ -324,7 +325,8 @@
 	    return err;
     }
     if (con == currcon)			/* current console? */
-	return fb_set_cmap(cmap, &fb_display[con].var, kspc, vfb_setcolreg);
+	return fb_set_cmap(cmap, &fb_display[con].var, kspc, vfb_setcolreg,
+			   info);
     else
 	fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
     return 0;
@@ -336,7 +338,7 @@
      */
 
 static int vfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-			    u_long arg, int con, int fbidx)
+		     u_long arg, int con, struct fb_info *info)
 {
     return -EINVAL;
 }
@@ -389,7 +391,7 @@
     if (err < 0)
 	return mem_start;
 
-    vfb_set_var(&vfb_default, -1, GET_FB_IDX(fb_info.node));
+    vfb_set_var(&vfb_default, -1, &fb_info);
 
     printk("Virtual frame buffer device, using %ldK of video memory\n",
 	   videomemorysize>>10);
@@ -397,16 +399,16 @@
 }
 
 
-static int vfbcon_switch(int con)
+static int vfbcon_switch(int con, struct fb_info *info)
 {
     /* Do we have to save the colormap? */
     if (fb_display[currcon].cmap.len)
 	fb_get_cmap(&fb_display[currcon].cmap, &fb_display[currcon].var, 1,
-		    vfb_getcolreg);
+		    vfb_getcolreg, info);
 
     currcon = con;
     /* Install new colormap */
-    do_install_cmap(con);
+    do_install_cmap(con, info);
     return 0;
 }
 
@@ -414,7 +416,7 @@
      *  Update the `var' structure (called by fbcon.c)
      */
 
-static int vfbcon_updatevar(int con)
+static int vfbcon_updatevar(int con, struct fb_info *info)
 {
     /* Nothing */
     return 0;
@@ -424,7 +426,7 @@
      *  Blank the display.
      */
 
-static void vfbcon_blank(int blank)
+static void vfbcon_blank(int blank, struct fb_info *info)
 {
     /* Nothing */
 }
@@ -525,7 +527,7 @@
      */
 
 static int vfb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
-                         u_int *transp)
+                         u_int *transp, struct fb_info *info)
 {
     if (regno > 255)
 	return 1;
@@ -543,7 +545,7 @@
      */
 
 static int vfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-                         u_int transp)
+                         u_int transp, struct fb_info *info)
 {
     if (regno > 255)
 	return 1;
@@ -554,16 +556,16 @@
 }
 
 
-static void do_install_cmap(int con)
+static void do_install_cmap(int con, struct fb_info *info)
 {
     if (con != currcon)
 	return;
     if (fb_display[con].cmap.len)
 	fb_set_cmap(&fb_display[con].cmap, &fb_display[con].var, 1,
-		    vfb_setcolreg);
+		    vfb_setcolreg, info);
     else
-	fb_set_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
-				    &fb_display[con].var, 1, vfb_setcolreg);
+	fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
+		    &fb_display[con].var, 1, vfb_setcolreg, info);
 }
 
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/drivers/video/vgacon.c m68k-2.1.72/drivers/video/vgacon.c
--- m68k-2.1.72-status/drivers/video/vgacon.c	Wed Dec 17 23:57:01 1997
+++ m68k-2.1.72/drivers/video/vgacon.c	Wed Jan  7 22:03:28 1998
@@ -312,7 +312,7 @@
 	 *	Find out if there is a graphics card present.
 	 *	Are there smarter methods around?
 	 */
-	p = (unsigned short *)video_mem_base;
+	p = (unsigned short *)vga_video_mem_base;
 	saved = vga_readw(p);
 	vga_writew(0xAA55, p);
 	if (vga_readw(p) != 0xAA55) {
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/include/asm-m68k/setup.h m68k-2.1.72/include/asm-m68k/setup.h
--- m68k-2.1.72-status/include/asm-m68k/setup.h	Wed Jan  7 22:13:29 1998
+++ m68k-2.1.72/include/asm-m68k/setup.h	Wed Jan  7 22:18:16 1998
@@ -68,10 +68,14 @@
 
 #if defined(CONFIG_MAC)
 #  error Currently no Mac support!
+#else
+#define MACH_IS_MAC (0)
 #endif
 
 #if defined(CONFIG_SUN3)
 #  error Currently no Sun-3 support!
+#else
+#define MACH_IS_SUN3 (0)
 #endif
 
 #if !defined (CONFIG_APOLLO)
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file m68k-2.1.72-status/include/linux/fb.h m68k-2.1.72/include/linux/fb.h
--- m68k-2.1.72-status/include/linux/fb.h	Fri Dec 26 21:42:13 1997
+++ m68k-2.1.72/include/linux/fb.h	Wed Jan  7 22:14:59 1998
@@ -80,6 +80,7 @@
 #define FB_ACCEL_CYBERVISION3D	5	/* Cybervision64/3D (S3 ViRGE)	*/
 #define FB_ACCEL_MACH64		6	/* ATI Mach 64			*/
 #define FB_ACCEL_TGA		7	/* DEC 21030 TGA		*/
+#define FB_ACCEL_ATY		8	/* atyfb (ATI Mach64)		*/
 
 #define FB_SYNC_HOR_HIGH_ACT	1	/* horizontal sync high active	*/
 #define FB_SYNC_VERT_HIGH_ACT	2	/* vertical sync high active	*/
@@ -154,25 +155,40 @@
 
 #include <linux/fs.h>
 
+
+struct fb_info;
+struct fb_info_gen;
+
+
+    /*
+     *  Frame buffer operations
+     */
+
 struct fb_ops {
-	/* open/release and usage marking */
-	int (*fb_open) (int);
-	int (*fb_release) (int);
-	/* get non settable parameters	*/
-	int (*fb_get_fix) (struct fb_fix_screeninfo *, int, int); 
-	/* get settable parameters	*/
-	int (*fb_get_var) (struct fb_var_screeninfo *, int, int);		
-	/* set settable parameters	*/
-	int (*fb_set_var) (struct fb_var_screeninfo *, int, int);		
-	/* get colormap			*/
-	int (*fb_get_cmap) (struct fb_cmap *, int, int, int);
-	/* set colormap			*/
-	int (*fb_set_cmap) (struct fb_cmap *, int, int, int);
-	/* pan display                   */
-	int (*fb_pan_display) (struct fb_var_screeninfo *, int, int);
-	/* perform fb specific ioctl	*/
-	int (*fb_ioctl)(struct inode *, struct file *, unsigned int,
-			unsigned long, int, int);
+    /* open/release and usage marking */
+    int (*fb_open)(struct fb_info *info);
+    int (*fb_release)(struct fb_info *info);
+    /* get non settable parameters */
+    int (*fb_get_fix)(struct fb_fix_screeninfo *fix, int con,
+		      struct fb_info *info); 
+    /* get settable parameters */
+    int (*fb_get_var)(struct fb_var_screeninfo *var, int con,
+		      struct fb_info *info);		
+    /* set settable parameters */
+    int (*fb_set_var)(struct fb_var_screeninfo *var, int con,
+		      struct fb_info *info);		
+    /* get colormap */
+    int (*fb_get_cmap)(struct fb_cmap *cmap, int kspc, int con,
+		       struct fb_info *info);
+    /* set colormap */
+    int (*fb_set_cmap)(struct fb_cmap *cmap, int kspc, int con,
+		       struct fb_info *info);
+    /* pan display */
+    int (*fb_pan_display)(struct fb_var_screeninfo *var, int con,
+			  struct fb_info *info);
+    /* perform fb specific ioctl */
+    int (*fb_ioctl)(struct inode *inode, struct file *file, unsigned int cmd,
+		    unsigned long arg, int con, struct fb_info *info);
 };
 
 
@@ -228,12 +244,86 @@
    char modename[40];               /* default video mode */
    int node;
    struct fb_ops *fbops;
-   struct display *disp;            /* initial display variable */
-   char fontname[40];               /* default font name */
-   int (*changevar)(int);           /* tell console var has changed */
-   int (*switch_con)(int);          /* tell fb to switch consoles */
-   int (*updatevar)(int);           /* tell fb to update the vars */
-   void (*blank)(int);              /* tell fb to (un)blank the screen */
+   struct display *disp;		/* initial display variable */
+   char fontname[40];			/* default font name */
+   int (*changevar)(int);		/* tell console var has changed */
+   int (*switch_con)(int, struct fb_info*);
+					/* tell fb to switch consoles */
+   int (*updatevar)(int, struct fb_info*);
+					/* tell fb to update the vars */
+   void (*blank)(int, struct fb_info*);	/* tell fb to (un)blank the screen */
+
+   /* From here on everything is device dependent */
+};
+
+
+    /*
+     *  This structure abstracts from the underlying hardware. It is not
+     *  mandatory but used by the `generic' frame buffer operations.
+     */
+
+struct fbgen_hwswitch {
+    int (*detect)(void);
+    /* This function should detect the current video mode settings and	*/
+    /* store them in xxxfb_predefined[0] for later reference by the	*/
+    /* user. Return the index+1 of an equivalent predefined mode or 0	*/
+    /* if there is no such.						*/
+
+    int (*encode_fix)(struct fb_fix_screeninfo *fix, const void *par,
+		      struct fb_info_gen *info);
+    /* This function should fill in the 'fix' structure based on the	*/
+    /* values in the 'par' structure.					*/
+
+    int (*decode_var)(const struct fb_var_screeninfo *var, void *par,
+		      struct fb_info_gen *info);
+    /* Get the video params out of 'var'. If a value doesn't fit, round	*/
+    /* it up, if it's too big, return EINVAL.				*/
+    /* Round up in the following order: bits_per_pixel, xres, yres,	*/
+    /* xres_virtual, yres_virtual, xoffset, yoffset, grayscale,		*/
+    /* bitfields, horizontal timing, vertical timing.			*/
+
+    int (*encode_var)(struct fb_var_screeninfo *var, const void *par,
+		      struct fb_info_gen *info);
+    /* Fill the 'var' structure based on the values in 'par' and maybe	*/
+    /* other values read out of the hardware.				*/
+
+    void (*get_par)(void *par, struct fb_info_gen *info);
+    /* Fill the hardware's 'par' structure.				*/
+
+    void (*set_par)(const void *par, struct fb_info_gen *info);
+    /* Set the hardware according to 'par'.				*/
+
+    int (*getcolreg)(unsigned regno, unsigned *red, unsigned *green,
+		     unsigned *blue, unsigned *transp, struct fb_info *info);
+    /* Read a single color register and split it into			*/
+    /* colors/transparent. Return != 0 for invalid regno.		*/
+
+    int (*setcolreg)(unsigned regno, unsigned red, unsigned green,
+		     unsigned blue, unsigned transp, struct fb_info *info);
+    /* Set a single color register. The values supplied are already	*/
+    /* rounded down to the hardware's capabilities (according to the	*/
+    /* entries in the var structure). Return != 0 for invalid regno.	*/
+
+    int (*pan_display)(const struct fb_var_screeninfo *var,
+		       struct fb_info_gen *info);
+    /* Pan the display (using the current `par' structure).		*/
+
+    int (*blank)(int blank_mode, struct fb_info_gen *info);
+    /* Blank the screen if blank_mode != 0, else unblank. If NULL then	*/
+    /* blanking is done by setting the CLUT to black. Return != 0 if	*/
+    /* un-/blanking failed due to e.g. video mode which doesn't support	*/
+    /* it. */
+};
+
+struct fb_info_gen {
+    struct fb_info info;
+
+    /* Entries for a generic frame buffer device */
+    /* Yes, this starts looking like C++ */
+    u_int parsize;
+    struct fbgen_hwswitch *fbhw;
+
+   /* From here on everything is device dependent */
 };
 
 
@@ -264,11 +354,14 @@
 			 int fsfromto);
 extern int fb_get_cmap(struct fb_cmap *cmap, struct fb_var_screeninfo *var,
 		       int kspc, int (*getcolreg)(u_int, u_int *, u_int *,
-						  u_int *, u_int *));
+						  u_int *, u_int *,
+						  struct fb_info *),
+		       struct fb_info *fb_info);
 extern int fb_set_cmap(struct fb_cmap *cmap, struct fb_var_screeninfo *var,
 		       int kspc, int (*setcolreg)(u_int, u_int, u_int, u_int,
-						  u_int));
-extern struct fb_cmap *fb_default_cmap(int bpp);
+						  u_int, struct fb_info *),
+		       struct fb_info *fb_info);
+extern struct fb_cmap *fb_default_cmap(int len);
 extern void fb_invert_cmaps(void);
 
 #endif /* __KERNEL__ */
Binary files m68k-2.1.72-status/scripts/lxdialog/lxdialog and m68k-2.1.72/scripts/lxdialog/lxdialog differ
Binary files m68k-2.1.72-status/vmlinux.gz and m68k-2.1.72/vmlinux.gz differ

Greetings,

						Geert

--
Geert Uytterhoeven                     Geert.Uytterhoeven@cs.kuleuven.ac.be
Wavelets, Linux/{m68k~Amiga,PPC~CHRP}  http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium

