diff options
author | obrien <obrien@FreeBSD.org> | 2001-11-01 08:26:30 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2001-11-01 08:26:30 +0000 |
commit | fd411045d4586653d5e42779a5bf8ebedbe4c87f (patch) | |
tree | 08b3875854d4387f5752ca5c0d5b08f97674e27b | |
parent | f59e3c6a46b4cb4c5d97c6d61628b753ac1d3900 (diff) | |
download | FreeBSD-src-fd411045d4586653d5e42779a5bf8ebedbe4c87f.zip FreeBSD-src-fd411045d4586653d5e42779a5bf8ebedbe4c87f.tar.gz |
Add the TGA video driver. This is a great accomplishtment and will help
us a lot on older Alphas.
Andrew Gallatin, Thomas V. Crimi, and Peter Jeremy contributed to this
work along with the submitter.
Submitted by: Andrew M. Miklic <miklic@home.com>
-rw-r--r-- | sys/dev/fb/boot_font.c | 4678 | ||||
-rw-r--r-- | sys/dev/fb/gfb.c | 948 | ||||
-rw-r--r-- | sys/dev/fb/gfb.h | 172 | ||||
-rw-r--r-- | sys/dev/fb/tga.c | 2431 | ||||
-rw-r--r-- | sys/dev/fb/tga.h | 155 | ||||
-rw-r--r-- | sys/dev/gfb/gfb_pci.c | 322 | ||||
-rw-r--r-- | sys/dev/gfb/gfb_pci.h | 114 | ||||
-rw-r--r-- | sys/dev/syscons/scgfbrndr.c | 884 | ||||
-rw-r--r-- | sys/dev/tga/tga_pci.c | 252 | ||||
-rw-r--r-- | sys/dev/tga/tga_pci.h | 299 |
10 files changed, 9539 insertions, 716 deletions
diff --git a/sys/dev/fb/boot_font.c b/sys/dev/fb/boot_font.c new file mode 100644 index 0000000..db82efc --- /dev/null +++ b/sys/dev/fb/boot_font.c @@ -0,0 +1,4678 @@ +/*- + * Copyright (c) 1999 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Andrew Doran. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This font lives in the public domain. It it a PC font, IBM encoding, + * which was designed for use with syscons. + * + * Copyright (c) 2000 Andrew Miklic + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/conf.h> +#include <sys/proc.h> +#include <sys/fcntl.h> +#include <sys/malloc.h> +#include <sys/fbio.h> + +#include <isa/isareg.h> +#include <dev/fb/vgareg.h> + +#include <vm/vm.h> +#include <vm/vm_param.h> +#include <vm/pmap.h> + +#include <machine/md_var.h> +#include <machine/pc/bios.h> +#include <machine/clock.h> +#include <machine/bus_memio.h> +#include <machine/bus.h> +#include <machine/pc/vesa.h> +#include <machine/resource.h> +#include <machine/rpb.h> + +#include <sys/bus.h> +#include <sys/rman.h> + +#include <pci/pcireg.h> +#include <pci/pcivar.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/gfb.h> +#include <dev/gfb/gfb_pci.h> + +#include "opt_fb.h" + +struct gfb_font bold8x16 = { + 8, + 16, + { + /* \00 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \01 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3c, /* ..****.. */ + 0x42, /* .*....*. */ + 0x81, /* *......* */ + 0xe7, /* ***..*** */ + 0xa5, /* *.*..*.* */ + 0x99, /* *..**..* */ + 0x81, /* *......* */ + 0x99, /* *..**..* */ + 0x42, /* .*....*. */ + 0x3c, /* ..****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \02 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3c, /* ..****.. */ + 0x7e, /* .******. */ + 0xff, /* ******** */ + 0x99, /* *..**..* */ + 0xdb, /* **.**.** */ + 0xe7, /* ***..*** */ + 0xff, /* ******** */ + 0xe7, /* ***..*** */ + 0x7e, /* .******. */ + 0x3c, /* ..****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \03 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x6c, /* .**.**.. */ + 0xfe, /* *******. */ + 0xfe, /* *******. */ + 0xfe, /* *******. */ + 0xfe, /* *******. */ + 0xfe, /* *******. */ + 0x7c, /* .*****.. */ + 0x38, /* ..***... */ + 0x10, /* ...*.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \04 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x10, /* ...*.... */ + 0x38, /* ..***... */ + 0x7c, /* .*****.. */ + 0xfe, /* *******. */ + 0x7c, /* .*****.. */ + 0x38, /* ..***... */ + 0x10, /* ...*.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \05 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x10, /* ...*.... */ + 0xd6, /* **.*.**. */ + 0xfe, /* *******. */ + 0xd6, /* **.*.**. */ + 0x10, /* ...*.... */ + 0x38, /* ..***... */ + 0x7c, /* .*****.. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \06 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x10, /* ...*.... */ + 0x38, /* ..***... */ + 0x7c, /* .*****.. */ + 0xfe, /* *******. */ + 0xfe, /* *******. */ + 0x54, /* .*.*.*.. */ + 0x10, /* ...*.... */ + 0x38, /* ..***... */ + 0x7c, /* .*****.. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \07 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \010 */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xe7, /* ***..*** */ + 0xc3, /* **....** */ + 0xc3, /* **....** */ + 0xe7, /* ***..*** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + + /* \011 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3c, /* ..****.. */ + 0x66, /* .**..**. */ + 0x42, /* .*....*. */ + 0x42, /* .*....*. */ + 0x66, /* .**..**. */ + 0x3c, /* ..****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \012 */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xc3, /* **....** */ + 0x99, /* *..**..* */ + 0xbd, /* *.****.* */ + 0xbd, /* *.****.* */ + 0x99, /* *..**..* */ + 0xc3, /* **....** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + + /* \013 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x1e, /* ...****. */ + 0x0e, /* ....***. */ + 0x1a, /* ...**.*. */ + 0x30, /* ..**.... */ + 0x78, /* .****... */ + 0xcc, /* **..**.. */ + 0xcc, /* **..**.. */ + 0xcc, /* **..**.. */ + 0xcc, /* **..**.. */ + 0x78, /* .****... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \014 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3c, /* ..****.. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x3c, /* ..****.. */ + 0x18, /* ...**... */ + 0x7e, /* .******. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \015 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x10, /* ...*.... */ + 0x18, /* ...**... */ + 0x14, /* ...*.*.. */ + 0x14, /* ...*.*.. */ + 0x14, /* ...*.*.. */ + 0x10, /* ...*.... */ + 0x10, /* ...*.... */ + 0x30, /* ..**.... */ + 0x70, /* .***.... */ + 0x20, /* ..*..... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \016 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3e, /* ..*****. */ + 0x22, /* ..*...*. */ + 0x3e, /* ..*****. */ + 0x22, /* ..*...*. */ + 0x22, /* ..*...*. */ + 0x22, /* ..*...*. */ + 0x22, /* ..*...*. */ + 0x26, /* ..*..**. */ + 0x6e, /* .**.***. */ + 0xe4, /* ***..*.. */ + 0x40, /* .*...... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \017 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x10, /* ...*.... */ + 0x92, /* *..*..*. */ + 0x54, /* .*.*.*.. */ + 0x28, /* ..*.*... */ + 0xc6, /* **...**. */ + 0x28, /* ..*.*... */ + 0x54, /* .*.*.*.. */ + 0x92, /* *..*..*. */ + 0x10, /* ...*.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \020 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x60, /* .**..... */ + 0x70, /* .***.... */ + 0x78, /* .****... */ + 0x7c, /* .*****.. */ + 0x7e, /* .******. */ + 0x7e, /* .******. */ + 0x7c, /* .*****.. */ + 0x78, /* .****... */ + 0x70, /* .***.... */ + 0x60, /* .**..... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \021 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x06, /* .....**. */ + 0x0e, /* ....***. */ + 0x1e, /* ...****. */ + 0x3e, /* ..*****. */ + 0x7e, /* .******. */ + 0x7e, /* .******. */ + 0x3e, /* ..*****. */ + 0x1e, /* ...****. */ + 0x0e, /* ....***. */ + 0x06, /* .....**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \022 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x10, /* ...*.... */ + 0x38, /* ..***... */ + 0x7c, /* .*****.. */ + 0xfe, /* *******. */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0xfe, /* *******. */ + 0x7c, /* .*****.. */ + 0x38, /* ..***... */ + 0x10, /* ...*.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \023 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x00, /* ........ */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \024 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7e, /* .******. */ + 0xf4, /* ****.*.. */ + 0xf4, /* ****.*.. */ + 0xf4, /* ****.*.. */ + 0x74, /* .***.*.. */ + 0x14, /* ...*.*.. */ + 0x14, /* ...*.*.. */ + 0x14, /* ...*.*.. */ + 0x14, /* ...*.*.. */ + 0x14, /* ...*.*.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \025 */ + 0x00, /* ........ */ + 0x1e, /* ...****. */ + 0x30, /* ..**.... */ + 0x78, /* .****... */ + 0xdc, /* **.***.. */ + 0xce, /* **..***. */ + 0xe7, /* ***..*** */ + 0x73, /* .***..** */ + 0x3b, /* ..***.** */ + 0x1e, /* ...****. */ + 0x0c, /* ....**.. */ + 0x78, /* .****... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \026 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0xfe, /* *******. */ + 0xfe, /* *******. */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \027 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x10, /* ...*.... */ + 0x38, /* ..***... */ + 0x7c, /* .*****.. */ + 0xfe, /* *******. */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0xfe, /* *******. */ + 0x7c, /* .*****.. */ + 0x38, /* ..***... */ + 0x10, /* ...*.... */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + + /* \030 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x10, /* ...*.... */ + 0x38, /* ..***... */ + 0x7c, /* .*****.. */ + 0xfe, /* *******. */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \031 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0xfe, /* *******. */ + 0x7c, /* .*****.. */ + 0x38, /* ..***... */ + 0x10, /* ...*.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \032 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x08, /* ....*... */ + 0x0c, /* ....**.. */ + 0xfe, /* *******. */ + 0xff, /* ******** */ + 0xfe, /* *******. */ + 0x0c, /* ....**.. */ + 0x08, /* ....*... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \033 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x10, /* ...*.... */ + 0x30, /* ..**.... */ + 0x7f, /* .******* */ + 0xff, /* ******** */ + 0x7f, /* .******* */ + 0x30, /* ..**.... */ + 0x10, /* ...*.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \034 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x33, /* ..**..** */ + 0x66, /* .**..**. */ + 0xee, /* ***.***. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \035 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x24, /* ..*..*.. */ + 0x66, /* .**..**. */ + 0xff, /* ******** */ + 0x66, /* .**..**. */ + 0x24, /* ..*..*.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \036 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x3c, /* ..****.. */ + 0x7e, /* .******. */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \037 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0x7e, /* .******. */ + 0x3c, /* ..****.. */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ! */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* " */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x77, /* .***.*** */ + 0x66, /* .**..**. */ + 0xcc, /* **..**.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* # */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0xfe, /* *******. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0xfe, /* *******. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* $ */ + 0x00, /* ........ */ + 0x10, /* ...*.... */ + 0x10, /* ...*.... */ + 0x7c, /* .*****.. */ + 0xd6, /* **.*.**. */ + 0xd0, /* **.*.... */ + 0xd0, /* **.*.... */ + 0x7c, /* .*****.. */ + 0x16, /* ...*.**. */ + 0x16, /* ...*.**. */ + 0xd6, /* **.*.**. */ + 0x7c, /* .*****.. */ + 0x10, /* ...*.... */ + 0x10, /* ...*.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* % */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc4, /* **...*.. */ + 0x0c, /* ....**.. */ + 0x08, /* ....*... */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x20, /* ..*..... */ + 0x60, /* .**..... */ + 0x46, /* .*...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* & */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x38, /* ..***... */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x38, /* ..***... */ + 0x76, /* .***.**. */ + 0xdc, /* **.***.. */ + 0xcc, /* **..**.. */ + 0xcc, /* **..**.. */ + 0xcc, /* **..**.. */ + 0x76, /* .***.**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ' */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x1c, /* ...***.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ( */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x18, /* ...**... */ + 0x0c, /* ....**.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ) */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x30, /* ..**.... */ + 0x18, /* ...**... */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* * */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x66, /* .**..**. */ + 0x3c, /* ..****.. */ + 0xff, /* ******** */ + 0x3c, /* ..****.. */ + 0x66, /* .**..**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* + */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x7e, /* .******. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* , */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x1c, /* ...***.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* - */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* . */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* / */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x06, /* .....**. */ + 0x04, /* .....*.. */ + 0x0c, /* ....**.. */ + 0x08, /* ....*... */ + 0x18, /* ...**... */ + 0x10, /* ...*.... */ + 0x30, /* ..**.... */ + 0x20, /* ..*..... */ + 0x60, /* .**..... */ + 0x40, /* .*...... */ + 0xc0, /* **...... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* 0 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xd6, /* **.*.**. */ + 0xd6, /* **.*.**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* 1 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x38, /* ..***... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* 2 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x60, /* .**..... */ + 0xc0, /* **...... */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* 3 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x3c, /* ..****.. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* 4 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x0c, /* ....**.. */ + 0x1c, /* ...***.. */ + 0x3c, /* ..****.. */ + 0x6c, /* .**.**.. */ + 0xcc, /* **..**.. */ + 0xfe, /* *******. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* 5 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xfc, /* ******.. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* 6 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3c, /* ..****.. */ + 0x60, /* .**..... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xfc, /* ******.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* 7 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* 8 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* 9 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7e, /* .******. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x0c, /* ....**.. */ + 0x78, /* .****... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* : */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ; */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* < */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x06, /* .....**. */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x60, /* .**..... */ + 0x60, /* .**..... */ + 0x30, /* ..**.... */ + 0x18, /* ...**... */ + 0x0c, /* ....**.. */ + 0x06, /* .....**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* = */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* > */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x60, /* .**..... */ + 0x30, /* ..**.... */ + 0x18, /* ...**... */ + 0x0c, /* ....**.. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x60, /* .**..... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ? */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x1c, /* ...***.. */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x00, /* ........ */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* @ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xde, /* **.****. */ + 0xde, /* **.****. */ + 0xde, /* **.****. */ + 0xde, /* **.****. */ + 0xdc, /* **.***.. */ + 0xc0, /* **...... */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* A */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* B */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfc, /* ******.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xfc, /* ******.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xfc, /* ******.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* C */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3c, /* ..****.. */ + 0x66, /* .**..**. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0x66, /* .**..**. */ + 0x3c, /* ..****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* D */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xf8, /* *****... */ + 0xcc, /* **..**.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xcc, /* **..**.. */ + 0xf8, /* *****... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* E */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xfc, /* ******.. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* F */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xfc, /* ******.. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* G */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3c, /* ..****.. */ + 0x66, /* .**..**. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xce, /* **..***. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x66, /* .**..**. */ + 0x3c, /* ..****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* H */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xfe, /* *******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* I */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3c, /* ..****.. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x3c, /* ..****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* J */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x1e, /* ...****. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0xcc, /* **..**.. */ + 0xcc, /* **..**.. */ + 0x78, /* .****... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* K */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xcc, /* **..**.. */ + 0xd8, /* **.**... */ + 0xf0, /* ****.... */ + 0xe0, /* ***..... */ + 0xe0, /* ***..... */ + 0xf0, /* ****.... */ + 0xd8, /* **.**... */ + 0xcc, /* **..**.. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* L */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* M */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xee, /* ***.***. */ + 0xfe, /* *******. */ + 0xfe, /* *******. */ + 0xd6, /* **.*.**. */ + 0xd6, /* **.*.**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* N */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xe6, /* ***..**. */ + 0xf6, /* ****.**. */ + 0xfe, /* *******. */ + 0xde, /* **.****. */ + 0xce, /* **..***. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* O */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* P */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfc, /* ******.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xfc, /* ******.. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* Q */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xf6, /* ****.**. */ + 0xde, /* **.****. */ + 0x7c, /* .*****.. */ + 0x0c, /* ....**.. */ + 0x06, /* .....**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* R */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfc, /* ******.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xfc, /* ******.. */ + 0xd8, /* **.**... */ + 0xcc, /* **..**.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* S */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc0, /* **...... */ + 0x60, /* .**..... */ + 0x38, /* ..***... */ + 0x0c, /* ....**.. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* T */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7e, /* .******. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* U */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* V */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x10, /* ...*.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* W */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xd6, /* **.*.**. */ + 0xd6, /* **.*.**. */ + 0xfe, /* *******. */ + 0xee, /* ***.***. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* X */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* Y */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x3c, /* ..****.. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* Z */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x60, /* .**..... */ + 0x60, /* .**..... */ + 0xc0, /* **...... */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* [ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3c, /* ..****.. */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x3c, /* ..****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc0, /* **...... */ + 0x40, /* .*...... */ + 0x60, /* .**..... */ + 0x20, /* ..*..... */ + 0x30, /* ..**.... */ + 0x10, /* ...*.... */ + 0x18, /* ...**... */ + 0x08, /* ....*... */ + 0x0c, /* ....**.. */ + 0x04, /* .....*.. */ + 0x06, /* .....**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ] */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3c, /* ..****.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x0c, /* ....**.. */ + 0x3c, /* ..****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ^ */ + 0x00, /* ........ */ + 0x10, /* ...*.... */ + 0x38, /* ..***... */ + 0x6c, /* .**.**.. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* _ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xff, /* ******** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ` */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x38, /* ..***... */ + 0x18, /* ...**... */ + 0x0c, /* ....**.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* a */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0x06, /* .....**. */ + 0x7e, /* .******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* b */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xfc, /* ******.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xfc, /* ******.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* c */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* d */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x7e, /* .******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* e */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xfe, /* *******. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* f */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3c, /* ..****.. */ + 0x66, /* .**..**. */ + 0x60, /* .**..... */ + 0x60, /* .**..... */ + 0xf0, /* ****.... */ + 0x60, /* .**..... */ + 0x60, /* .**..... */ + 0x60, /* .**..... */ + 0x60, /* .**..... */ + 0x60, /* .**..... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* g */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7e, /* .******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7e, /* .******. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + + /* h */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xfc, /* ******.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* i */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* j */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x00, /* ........ */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x66, /* .**..**. */ + 0x3c, /* ..****.. */ + 0x00, /* ........ */ + + /* k */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc6, /* **...**. */ + 0xcc, /* **..**.. */ + 0xd8, /* **.**... */ + 0xf0, /* ****.... */ + 0xd8, /* **.**... */ + 0xcc, /* **..**.. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* l */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x38, /* ..***... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x3c, /* ..****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* m */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xec, /* ***.**.. */ + 0xd6, /* **.*.**. */ + 0xd6, /* **.*.**. */ + 0xd6, /* **.*.**. */ + 0xd6, /* **.*.**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* n */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfc, /* ******.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* o */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* p */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfc, /* ******.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xfc, /* ******.. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0x00, /* ........ */ + + /* q */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7e, /* .******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7e, /* .******. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x00, /* ........ */ + + /* r */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfc, /* ******.. */ + 0xc6, /* **...**. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* s */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc0, /* **...... */ + 0x70, /* .***.... */ + 0x1c, /* ...***.. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* t */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x10, /* ...*.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0xfc, /* ******.. */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x30, /* ..**.... */ + 0x1c, /* ...***.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* u */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* v */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x6c, /* .**.**.. */ + 0x38, /* ..***... */ + 0x10, /* ...*.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* w */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xd6, /* **.*.**. */ + 0xd6, /* **.*.**. */ + 0xfe, /* *******. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* x */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0x6c, /* .**.**.. */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x38, /* ..***... */ + 0x6c, /* .**.**.. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* y */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7e, /* .******. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + + /* z */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0x06, /* .....**. */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x60, /* .**..... */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* { */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x0e, /* ....***. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x60, /* .**..... */ + 0x60, /* .**..... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x0e, /* ....***. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* | */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* } */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x70, /* .***.... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x70, /* .***.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ~ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x76, /* .***.**. */ + 0xdc, /* **.***.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0177 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x10, /* ...*.... */ + 0x38, /* ..***... */ + 0x6c, /* .**.**.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0200 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3c, /* ..****.. */ + 0x66, /* .**..**. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0x66, /* .**..**. */ + 0x3c, /* ..****.. */ + 0x18, /* ...**... */ + 0x98, /* *..**... */ + 0x70, /* .***.... */ + 0x00, /* ........ */ + + /* \0201 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0202 */ + 0x00, /* ........ */ + 0x06, /* .....**. */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xfe, /* *******. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0203 */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x3c, /* ..****.. */ + 0x66, /* .**..**. */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0x06, /* .....**. */ + 0x7e, /* .******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0204 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0x06, /* .....**. */ + 0x7e, /* .******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0205 */ + 0x00, /* ........ */ + 0x60, /* .**..... */ + 0x30, /* ..**.... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0x06, /* .....**. */ + 0x7e, /* .******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0206 */ + 0x38, /* ..***... */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x38, /* ..***... */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0x06, /* .....**. */ + 0x7e, /* .******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0207 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x38, /* ..***... */ + 0x98, /* *..**... */ + 0x70, /* .***.... */ + 0x00, /* ........ */ + + /* \0210 */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x3c, /* ..****.. */ + 0x66, /* .**..**. */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xfe, /* *******. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0211 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xfe, /* *******. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0212 */ + 0x00, /* ........ */ + 0x60, /* .**..... */ + 0x30, /* ..**.... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xfe, /* *******. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0213 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0214 */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x3c, /* ..****.. */ + 0x66, /* .**..**. */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0215 */ + 0x00, /* ........ */ + 0x60, /* .**..... */ + 0x30, /* ..**.... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0216 */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x10, /* ...*.... */ + 0x38, /* ..***... */ + 0x6c, /* .**.**.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xfe, /* *******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0217 */ + 0x38, /* ..***... */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x38, /* ..***... */ + 0x6c, /* .**.**.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xfe, /* *******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0220 */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0xfe, /* *******. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xfc, /* ******.. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0221 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7e, /* .******. */ + 0xdb, /* **.**.** */ + 0x1b, /* ...**.** */ + 0x7f, /* .******* */ + 0xd8, /* **.**... */ + 0xdb, /* **.**.** */ + 0x6e, /* .**.***. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0222 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3f, /* ..****** */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x6c, /* .**.**.. */ + 0x6f, /* .**.**** */ + 0x6c, /* .**.**.. */ + 0x7c, /* .*****.. */ + 0xcc, /* **..**.. */ + 0xcc, /* **..**.. */ + 0xcf, /* **..**** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0223 */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x3c, /* ..****.. */ + 0x66, /* .**..**. */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0224 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0225 */ + 0x00, /* ........ */ + 0x60, /* .**..... */ + 0x30, /* ..**.... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0226 */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x3c, /* ..****.. */ + 0x66, /* .**..**. */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0227 */ + 0x00, /* ........ */ + 0x60, /* .**..... */ + 0x30, /* ..**.... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0230 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7e, /* .******. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + + /* \0231 */ + 0x6c, /* .**.**.. */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0232 */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0233 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x7e, /* .******. */ + 0xc3, /* **....** */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc3, /* **....** */ + 0x7e, /* .******. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0234 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x38, /* ..***... */ + 0x6c, /* .**.**.. */ + 0x60, /* .**..... */ + 0xf0, /* ****.... */ + 0x60, /* .**..... */ + 0xf0, /* ****.... */ + 0x60, /* .**..... */ + 0x60, /* .**..... */ + 0x66, /* .**..**. */ + 0xfc, /* ******.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0235 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x3c, /* ..****.. */ + 0x18, /* ...**... */ + 0x7e, /* .******. */ + 0x18, /* ...**... */ + 0x7e, /* .******. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0236 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfc, /* ******.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xfc, /* ******.. */ + 0xc6, /* **...**. */ + 0xcf, /* **..**** */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x07, /* .....*** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* \0237 */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x0e, /* ....***. */ + 0x1b, /* ...**.** */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x3c, /* ..****.. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0xd8, /* **.**... */ + 0x70, /* .***.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* */ + 0x00, /* ........ */ + 0x06, /* .....**. */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0x06, /* .....**. */ + 0x7e, /* .******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ¡ */ + 0x00, /* ........ */ + 0x06, /* .....**. */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ¢ */ + 0x00, /* ........ */ + 0x06, /* .....**. */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* £ */ + 0x00, /* ........ */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ¤ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x76, /* .***.**. */ + 0xdc, /* **.***.. */ + 0x00, /* ........ */ + 0xfc, /* ******.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ¥ */ + 0x76, /* .***.**. */ + 0xdc, /* **.***.. */ + 0x00, /* ........ */ + 0xc6, /* **...**. */ + 0xe6, /* ***..**. */ + 0xf6, /* ****.**. */ + 0xfe, /* *******. */ + 0xde, /* **.****. */ + 0xce, /* **..***. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ¦ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0x06, /* .....**. */ + 0x7e, /* .******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* § */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ¨ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x70, /* .***.... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc6, /* **...**. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* © */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ª */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x06, /* .....**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* « */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x38, /* ..***... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0xff, /* ******** */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x2c, /* ..*.**.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x3c, /* ..****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ¬ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x38, /* ..***... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0xff, /* ******** */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x38, /* ..***... */ + 0x68, /* .**.*... */ + 0x7c, /* .*****.. */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ® */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x36, /* ..**.**. */ + 0x6c, /* .**.**.. */ + 0xd8, /* **.**... */ + 0xd8, /* **.**... */ + 0x6c, /* .**.**.. */ + 0x36, /* ..**.**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ¯ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xd8, /* **.**... */ + 0x6c, /* .**.**.. */ + 0x36, /* ..**.**. */ + 0x36, /* ..**.**. */ + 0x6c, /* .**.**.. */ + 0xd8, /* **.**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ° */ + 0x82, /* *.....*. */ + 0x10, /* ...*.... */ + 0x82, /* *.....*. */ + 0x10, /* ...*.... */ + 0x82, /* *.....*. */ + 0x10, /* ...*.... */ + 0x82, /* *.....*. */ + 0x10, /* ...*.... */ + 0x82, /* *.....*. */ + 0x10, /* ...*.... */ + 0x82, /* *.....*. */ + 0x10, /* ...*.... */ + 0x82, /* *.....*. */ + 0x10, /* ...*.... */ + 0x82, /* *.....*. */ + 0x10, /* ...*.... */ + + /* ± */ + 0x00, /* ........ */ + 0x95, /* *..*.*.* */ + 0x00, /* ........ */ + 0xa9, /* *.*.*..* */ + 0x00, /* ........ */ + 0x95, /* *..*.*.* */ + 0x00, /* ........ */ + 0xa9, /* *.*.*..* */ + 0x00, /* ........ */ + 0x95, /* *..*.*.* */ + 0x00, /* ........ */ + 0xa9, /* *.*.*..* */ + 0x00, /* ........ */ + 0x95, /* *..*.*.* */ + 0x00, /* ........ */ + 0xa9, /* *.*.*..* */ + + /* ² */ + 0x92, /* *..*..*. */ + 0x49, /* .*..*..* */ + 0x92, /* *..*..*. */ + 0x49, /* .*..*..* */ + 0x92, /* *..*..*. */ + 0x49, /* .*..*..* */ + 0x92, /* *..*..*. */ + 0x49, /* .*..*..* */ + 0x92, /* *..*..*. */ + 0x49, /* .*..*..* */ + 0x92, /* *..*..*. */ + 0x49, /* .*..*..* */ + 0x92, /* *..*..*. */ + 0x49, /* .*..*..* */ + 0x92, /* *..*..*. */ + 0x49, /* .*..*..* */ + + /* ³ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* ´ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0xf8, /* *****... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* µ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0xf8, /* *****... */ + 0xf8, /* *****... */ + 0xf8, /* *****... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* ¶ */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0xfc, /* ******.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + + /* · */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfc, /* ******.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + + /* ¸ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xf8, /* *****... */ + 0xf8, /* *****... */ + 0xf8, /* *****... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* ¹ */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0xfc, /* ******.. */ + 0xfc, /* ******.. */ + 0xfc, /* ******.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + + /* º */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + + /* » */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfc, /* ******.. */ + 0xfc, /* ******.. */ + 0xfc, /* ******.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + + /* ¼ */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0xfc, /* ******.. */ + 0xfc, /* ******.. */ + 0xfc, /* ******.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ½ */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0xfc, /* ******.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ¾ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0xf8, /* *****... */ + 0xf8, /* *****... */ + 0xf8, /* *****... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ¿ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xf8, /* *****... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* À */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x1f, /* ...***** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* Á */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0xff, /* ******** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* Â */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xff, /* ******** */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* Ã */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x1f, /* ...***** */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* Ä */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xff, /* ******** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* Å */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0xff, /* ******** */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* Æ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x1f, /* ...***** */ + 0x1f, /* ...***** */ + 0x1f, /* ...***** */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* Ç */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3f, /* ..****** */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + + /* È */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3f, /* ..****** */ + 0x3f, /* ..****** */ + 0x3f, /* ..****** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* É */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3f, /* ..****** */ + 0x3f, /* ..****** */ + 0x3f, /* ..****** */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + + /* Ê */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* Ë */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + + /* Ì */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3f, /* ..****** */ + 0x3f, /* ..****** */ + 0x3f, /* ..****** */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + + /* Í */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* Î */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + + /* Ï */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* Ð */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0xff, /* ******** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* Ñ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* Ò */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xff, /* ******** */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + + /* Ó */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3f, /* ..****** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* Ô */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x1f, /* ...***** */ + 0x1f, /* ...***** */ + 0x1f, /* ...***** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* Õ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x1f, /* ...***** */ + 0x1f, /* ...***** */ + 0x1f, /* ...***** */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* Ö */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3f, /* ..****** */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + + /* × */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0xff, /* ******** */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + 0x3c, /* ..****.. */ + + /* Ø */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* Ù */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0xf8, /* *****... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* Ú */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x1f, /* ...***** */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* Û */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + + /* Ü */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + + /* Ý */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + 0xf0, /* ****.... */ + + /* Þ */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + 0x0f, /* ....**** */ + + /* ß */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0xff, /* ******** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* à */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x77, /* .***.*** */ + 0xcc, /* **..**.. */ + 0xcc, /* **..**.. */ + 0xcc, /* **..**.. */ + 0xde, /* **.****. */ + 0x73, /* .***..** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* á */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc4, /* **...*.. */ + 0xc8, /* **..*... */ + 0xc4, /* **...*.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xdc, /* **.***.. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* â */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0xc0, /* **...... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ã */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x03, /* ......** */ + 0x7e, /* .******. */ + 0xec, /* ***.**.. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x68, /* .**.*... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ä */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0xc6, /* **...**. */ + 0x60, /* .**..... */ + 0x30, /* ..**.... */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x60, /* .**..... */ + 0xc0, /* **...... */ + 0xc6, /* **...**. */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* å */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7f, /* .******* */ + 0xf0, /* ****.... */ + 0xd8, /* **.**... */ + 0xd8, /* **.**... */ + 0xd8, /* **.**... */ + 0xd8, /* **.**... */ + 0x70, /* .***.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* æ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x7c, /* .*****.. */ + 0x60, /* .**..... */ + 0x60, /* .**..... */ + 0xc0, /* **...... */ + 0x00, /* ........ */ + + /* ç */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x76, /* .***.**. */ + 0xdc, /* **.***.. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* è */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x7e, /* .******. */ + 0xdb, /* **.**.** */ + 0xdb, /* **.**.** */ + 0xdb, /* **.**.** */ + 0xdb, /* **.**.** */ + 0x7e, /* .******. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* é */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x38, /* ..***... */ + 0x6c, /* .**.**.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xfe, /* *******. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x6c, /* .**.**.. */ + 0x38, /* ..***... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ê */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x3c, /* ..****.. */ + 0x66, /* .**..**. */ + 0xc3, /* **....** */ + 0xc3, /* **....** */ + 0xc3, /* **....** */ + 0xc3, /* **....** */ + 0x66, /* .**..**. */ + 0x24, /* ..*..*.. */ + 0xa5, /* *.*..*.* */ + 0xe7, /* ***..*** */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ë */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x1e, /* ...****. */ + 0x30, /* ..**.... */ + 0x18, /* ...**... */ + 0x0c, /* ....**.. */ + 0x3e, /* ..*****. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x66, /* .**..**. */ + 0x3c, /* ..****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ì */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7e, /* .******. */ + 0xdb, /* **.**.** */ + 0xdb, /* **.**.** */ + 0xdb, /* **.**.** */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* í */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x03, /* ......** */ + 0x06, /* .....**. */ + 0x7e, /* .******. */ + 0xcf, /* **..**** */ + 0xdb, /* **.**.** */ + 0xf3, /* ****..** */ + 0x7e, /* .******. */ + 0x60, /* .**..... */ + 0xc0, /* **...... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* î */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x1c, /* ...***.. */ + 0x30, /* ..**.... */ + 0x60, /* .**..... */ + 0x60, /* .**..... */ + 0x7c, /* .*****.. */ + 0x60, /* .**..... */ + 0x60, /* .**..... */ + 0x60, /* .**..... */ + 0x30, /* ..**.... */ + 0x1c, /* ...***.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ï */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0xc6, /* **...**. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ð */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xfe, /* *******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ñ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x7e, /* .******. */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ò */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x30, /* ..**.... */ + 0x18, /* ...**... */ + 0x0c, /* ....**.. */ + 0x06, /* .....**. */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x00, /* ........ */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ó */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x0c, /* ....**.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x60, /* .**..... */ + 0x30, /* ..**.... */ + 0x18, /* ...**... */ + 0x0c, /* ....**.. */ + 0x00, /* ........ */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ô */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x0e, /* ....***. */ + 0x1b, /* ...**.** */ + 0x1b, /* ...**.** */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + + /* õ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0xd8, /* **.**... */ + 0xd8, /* **.**... */ + 0x70, /* .***.... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ö */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x7e, /* .******. */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ÷ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x76, /* .***.**. */ + 0xdc, /* **.***.. */ + 0x00, /* ........ */ + 0x76, /* .***.**. */ + 0xdc, /* **.***.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ø */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x38, /* ..***... */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x38, /* ..***... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ù */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ú */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x18, /* ...**... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* û */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x03, /* ......** */ + 0x02, /* ......*. */ + 0x06, /* .....**. */ + 0x04, /* .....*.. */ + 0x0c, /* ....**.. */ + 0x08, /* ....*... */ + 0xd8, /* **.**... */ + 0x50, /* .*.*.... */ + 0x70, /* .***.... */ + 0x20, /* ..*..... */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ü */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0xd8, /* **.**... */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x6c, /* .**.**.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* ý */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x78, /* .****... */ + 0xcc, /* **..**.. */ + 0x18, /* ...**... */ + 0x30, /* ..**.... */ + 0x60, /* .**..... */ + 0xfc, /* ******.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + + /* þ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x7c, /* .*****.. */ + 0x7c, /* .*****.. */ + 0x7c, /* .*****.. */ + 0x7c, /* .*****.. */ + 0x7c, /* .*****.. */ + 0x7c, /* .*****.. */ + 0x7c, /* .*****.. */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + 0x00, /* ........ */ + } +}; diff --git a/sys/dev/fb/gfb.c b/sys/dev/fb/gfb.c new file mode 100644 index 0000000..f7c377c --- /dev/null +++ b/sys/dev/fb/gfb.c @@ -0,0 +1,948 @@ +/*- + * Copyright (c) 2001 Andrew Miklic + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* + * Copyright (c) 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <machine/stdarg.h> + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/conf.h> +#include <sys/proc.h> +#include <sys/fcntl.h> +#include <sys/malloc.h> +#include <sys/fbio.h> + +#include <vm/vm.h> +#include <vm/vm_param.h> +#include <vm/pmap.h> + +#include <machine/md_var.h> +#include <machine/pc/bios.h> +#include <machine/clock.h> +#include <machine/bus_memio.h> +#include <machine/bus.h> +#include <machine/pc/vesa.h> +#include <machine/resource.h> +#include <machine/rpb.h> + +#include <sys/bus.h> +#include <sys/rman.h> + +#include <pci/pcireg.h> +#include <pci/pcivar.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/gfb.h> +#include <dev/gfb/gfb_pci.h> + +#include "opt_gfb.h" + +struct gfb_softc *gfb_device_softcs[2][MAX_NUM_GFB_CARDS] = { + { + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + }, + { + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + }, +}; + +/* + The following 9 variables exist only because we need statically + allocated structures very early in boot to support gfb_configure()... +*/ +struct gfb_softc console; +video_adapter_t console_adp; +struct gfb_conf console_gfbc; +u_char console_palette_red[256]; +u_char console_palette_green[256]; +u_char console_palette_blue[256]; +u_char console_cursor_palette_red[3]; +u_char console_cursor_palette_green[3]; +u_char console_cursor_palette_blue[3]; + +extern struct gfb_font bold8x16; + +/***************************************************************************** + * + * FB-generic functions + * + ****************************************************************************/ + +int +gfb_probe(int unit, video_adapter_t **adpp, void *arg, int flags) +{ + int error; + + /* Assume the best... */ + error = 0; + + if((*adpp = vid_get_adapter(vid_find_adapter((char *)arg, unit))) == NULL) + error = ENODEV; + else + (*adpp)->va_flags |= V_ADP_PROBED; + + return(error); +} + +int +gfb_init(int unit, video_adapter_t *adp, int flags) +{ + struct gfb_softc *sc; + struct gfb_conf *gfbc; + int error; + + /* Assume the best... */ + error = 0; + + if(!init_done(adp)) { + sc = gfb_device_softcs[adp->va_model][unit]; + gfbc = sc->gfbc; + + /* Initialize the RAMDAC... */ + (*gfbc->ramdac_init)(sc); + + /* Initialize the palettes... */ + (*gfbc->ramdac_load_palette)(sc->adp, &sc->gfbc->palette); + (*gfbc->ramdac_load_cursor_palette)(sc->adp, + &sc->gfbc->cursor_palette); + + /* Prepare the default font... */ + (*vidsw[adp->va_index]->load_font)(adp, 0, bold8x16.height, + bold8x16.data, 0, 256); + adp->va_info.vi_cwidth = gfbc->fonts[0].width; + adp->va_info.vi_cheight = gfbc->fonts[0].height; + + /* + Normalize vi_width and vi_height to be in terms of + on-screen characters, rather than pixels (*_init() + leaves them in terms of pixels... + */ + adp->va_info.vi_width /= adp->va_info.vi_cwidth; + adp->va_info.vi_height /= adp->va_info.vi_cheight; + + /* Enable the default font... */ + (*vidsw[adp->va_index]->show_font)(adp, 0); + + /* Enable future font-loading... */ + adp->va_flags |= V_ADP_FONT; + + /* Flag this initialization for this adapter... */ + adp->va_flags |= V_ADP_INITIALIZED; + } + return(error); +} + +int +gfb_get_info(video_adapter_t *adp, int mode, video_info_t *info) +{ + int error; + + /* Assume the best... */ + error = 0; + + /* + The info for GFB adapters does not depend on its mode, + so just copy it indiscriminantly (actually, we originally + checked the mode, but the current fb framework is somewhat + sloppily done in places, and assumes VGA in several places, + which makes such checks always fail for such GFBs as TGA)... + */ + bcopy(&adp->va_info, info, sizeof(video_info_t)); + return(error); +} + +int +gfb_set_mode(video_adapter_t *adp, int mode) +{ + + adp->va_mode = mode; + return(0); +} + +int +gfb_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data, + int ch, int count) +{ + struct gfb_softc *sc; + int error; + int i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* Check the font information... */ + if((sc->gfbc->fonts[page].height != fontsize) || + (sc->gfbc->fonts[page].width != 8)) + error = EINVAL; + else + + /* + Copy the character pixel array from our + very own private cache... + */ + for(i = ch; i < count * fontsize; i++) + data[i] = adp->va_little_bitian ? + BIT_REVERSE(sc->gfbc->fonts[page].data[i]) : + sc->gfbc->fonts[page].data[i]; + + return(error); +} + +int +gfb_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data, + int ch, int count) +{ + struct gfb_softc *sc; + int error; + int i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* Copy the character pixel array into our very own private cache... */ + for(i = ch; i < count * fontsize; i++) + sc->gfbc->fonts[page].data[i] = adp->va_little_bitian ? + BIT_REVERSE(data[i]) : data[i]; + + /* Save the font information... */ + sc->gfbc->fonts[page].height = fontsize; + sc->gfbc->fonts[page].width = 8; + + return(error); +} + +int +gfb_show_font(video_adapter_t *adp, int page) +{ + struct gfb_softc *sc; + int error; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* Normalize adapter values... */ + adp->va_info.vi_height *= adp->va_info.vi_cheight; + adp->va_info.vi_width *= adp->va_info.vi_cwidth; + + /* Set the current font pixels... */ + sc->gfbc->font = sc->gfbc->fonts[page].data; + + /* Set the current font width... */ + adp->va_info.vi_cwidth = sc->gfbc->fonts[page].width; + + /* Set the current font height... */ + adp->va_info.vi_cheight = sc->gfbc->fonts[page].height; + + /* Recompute adapter values... */ + adp->va_info.vi_height /= adp->va_info.vi_cheight; + adp->va_info.vi_width /= adp->va_info.vi_cwidth; + + return(error); +} + +int +gfb_save_palette(video_adapter_t *adp, u_char *palette) +{ + struct gfb_softc *sc; + int error; + int i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + +#if 0 + /* If we have a RAMDAC-specific counterpart, use it... */ + if(sc->gfbc->ramdac_save_palette) + error = sc->gfbc->ramdac_save_palette(adp, &sc->gfbc->palette); + + else + /* Otherwise, use the built-in functionality... */ + error = sc->gfbc->builtin_save_palette(adp, &sc->gfbc->palette); +#endif + + for(i = 0; i < sc->gfbc->palette.count; i++) { + palette[(3 * i)] = sc->gfbc->palette.red[i]; + palette[(3 * i) + 1] = sc->gfbc->palette.green[i]; + palette[(3 * i) + 2] = sc->gfbc->palette.blue[i]; + } + return(error); +} + +int +gfb_load_palette(video_adapter_t *adp, u_char *palette) +{ + struct gfb_softc *sc; + int error; + int i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + for(i = 0; i < sc->gfbc->palette.count; i++) { + sc->gfbc->palette.red[i] = palette[(3 * i)]; + sc->gfbc->palette.green[i] = palette[(3 * i) + 1]; + sc->gfbc->palette.blue[i] = palette[(3 * i) + 2]; + } + + /* If we have a RAMDAC-specific counterpart, use it... */ + if(sc->gfbc->ramdac_load_palette) + error = sc->gfbc->ramdac_load_palette(adp, &sc->gfbc->palette); + else + /* Otherwise, use the built-in functionality... */ + error = sc->gfbc->builtin_load_palette(adp, &sc->gfbc->palette); + + return(error); +} + +int +gfb_set_border(video_adapter_t *adp, int color) +{ + + return(ENODEV); +} + +int +gfb_save_state(video_adapter_t *adp, void *p, size_t size) +{ + int i; + u_int32_t *regs; + + regs = (u_int32_t *)p; + regs[0] = size; + for(i = 1; i <= size; i++) + regs[i] = READ_GFB_REGISTER(adp, i); + return(0); +} + +int +gfb_load_state(video_adapter_t *adp, void *p) +{ + size_t size; + int i; + u_int32_t *regs; + + regs = (u_int32_t *)p; + size = regs[0]; + for(i = 1; i <= size; i++) + WRITE_GFB_REGISTER(adp, i, regs[i]); + return(0); +} + +int +gfb_set_win_org(video_adapter_t *adp, off_t offset) +{ + + adp->va_window_orig = offset; + return(0); +} + +int +gfb_read_hw_cursor(video_adapter_t *adp, int *col, int *row) +{ + struct gfb_softc *sc; + int error; + + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* If we have a RAMDAC-specific counterpart, use it... */ + if(sc->gfbc->ramdac_read_hw_cursor) + error = sc->gfbc->ramdac_read_hw_cursor(adp, col, row); + else + /* Otherwise, use the built-in functionality... */ + error = sc->gfbc->builtin_read_hw_cursor(adp, col, row); + + return(error); +} + +int +gfb_set_hw_cursor(adp, col, row) + video_adapter_t *adp; + int col; + int row; +{ + int error; + struct gfb_softc *sc; + + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* If we have a RAMDAC-specific counterpart, use it... */ + if(sc->gfbc->ramdac_set_hw_cursor) + error = sc->gfbc->ramdac_set_hw_cursor(adp, col, row); + + /* Otherwise, use the built-in functionality... */ + else + error = sc->gfbc->builtin_set_hw_cursor(adp, col, row); + return(error); +} + +int +gfb_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, + int cellsize, int blink) +{ + struct gfb_softc *sc; + int error; + + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* If we have a RAMDAC-specific counterpart, use it... */ + if(sc->gfbc->ramdac_set_hw_cursor_shape) + error = sc->gfbc->ramdac_set_hw_cursor_shape(adp, base, height, + cellsize, blink); + else + /* Otherwise, use the built-in functionality... */ + error = sc->gfbc->builtin_set_hw_cursor_shape(adp, base, + height, cellsize, blink); + + return(error); +} + +int +gfb_mmap(video_adapter_t *adp, vm_offset_t offset, int prot) +{ + int error; + + if(offset > adp->va_window_size - PAGE_SIZE) + error = ENXIO; +#ifdef __i386__ + error = i386_btop(adp->va_info.vi_window + offset); +#elsif defined(__alpha__) + error = alpha_btop(adp->va_info.vi_window + offset); +#else + error = ENXIO; +#endif + return(error); +} + +int +gfb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t arg) +{ + struct gfb_softc *sc; + int error; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + switch (cmd) { + case FBIOPUTCMAP: + /* FALLTHROUGH */ + case FBIO_GETWINORG: + /* FALLTHROUGH */ + case FBIO_SETWINORG: + /* FALLTHROUGH */ + case FBIO_SETDISPSTART: + /* FALLTHROUGH */ + case FBIO_SETLINEWIDTH: + /* FALLTHROUGH */ + case FBIO_GETPALETTE: + /* FALLTHROUGH */ + case FBIOGTYPE: + /* FALLTHROUGH */ + case FBIOGETCMAP: + /* FALLTHROUGH */ + default: + error = fb_commonioctl(adp, cmd, arg); + } + return(error); +} + +int +gfb_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy) +{ + int off; + + /* + Just traverse the buffer, one pixel span at a time, setting + each pixel to the block-color... + */ + for(off = (x * y); off < ((x + cx) * (y + cy)); off++) + (*vidsw[adp->va_index]->putp)(adp, off, 0x000007ff, 0xffffffff, + sizeof(u_int32_t), 1, 0, 0); + + return(0); +} + +int +gfb_bitblt(video_adapter_t *adp, ...) +{ + va_list args; + vm_offset_t src, dst; + int count, i; + u_int32_t val; + + va_start(args, adp); + + src = (va_arg(args, vm_offset_t) + adp->va_window_orig) & + 0x0000000000fffff8; + dst = (va_arg(args, vm_offset_t) + adp->va_window_orig) & + 0x0000000000fffff8; + count = va_arg(args, int); + for(i = 0; i < count; i++, src++, dst++) { + val = READ_GFB_BUFFER(adp, src); + WRITE_GFB_BUFFER(adp, dst, val); + } + va_end(args); + return(0); +} + +int +/*gfb_clear(video_adapter_t *adp, int n)*/ +gfb_clear(video_adapter_t *adp) + video_adapter_t *adp; +{ + int off; + +#if 0 + if(n == 0) + return(0); +#endif + + /* + Just traverse the buffer, one 2K-pixel span at a time, clearing + each pixel... + */ + /* for(off = 0; off < (n * adp->va_line_width); off += (2 KB)) */ + for(off = 0; off < adp->va_window_size; off++) + (*vidsw[adp->va_index]->putp)(adp, off, 0x000007ff, 0xffffffff, + sizeof(u_int32_t), 1, 0, 0); + + return(0); +} + +int +gfb_diag(video_adapter_t *adp, int level) +{ + video_info_t info; + struct gfb_softc *sc; + int error; + + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* Just dump everything we know about the adapter to the screen... */ + fb_dump_adp_info(sc->driver_name, adp, level); + + /* Try to get the info on this adapter... */ + if(!(error = (*vidsw[adp->va_index]->get_info)(adp, + adp->va_initial_mode, &info))) + /* + Just dump everything we know about the adapter's mode + to the screen... + */ + fb_dump_mode_info(sc->driver_name, adp, &info, level); + + return(error); +} + +int +gfb_save_cursor_palette(video_adapter_t *adp, u_char *palette) +{ + struct gfb_softc *sc; + int error, i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + +#if 0 + /* If we have a RAMDAC-specific counterpart, use it... */ + if(sc->gfbc->ramdac_save_cursor_palette) + error = sc->gfbc->ramdac_save_cursor_palette(adp, + &sc->gfbc->cursor_palette); + + else + /* Otherwise, use the built-in functionality... */ + error = sc->gfbc->builtin_save_cursor_palette(adp, + &sc->gfbc->cursor_palette); +#endif + + for(i = 0; i < sc->gfbc->cursor_palette.count; i++) { + palette[(3 * i)] = sc->gfbc->cursor_palette.red[i]; + palette[(3 * i) + 1] = sc->gfbc->cursor_palette.green[i]; + palette[(3 * i) + 2] = sc->gfbc->cursor_palette.blue[i]; + } + return(error); +} + +int +gfb_load_cursor_palette(video_adapter_t *adp, u_char *palette) +{ + struct gfb_softc *sc; + int error, i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + for(i = 0; i < sc->gfbc->cursor_palette.count; i++) { + sc->gfbc->cursor_palette.red[i] = palette[(3 * i)]; + sc->gfbc->cursor_palette.green[i] = palette[(3 * i) + 1]; + sc->gfbc->cursor_palette.blue[i] = palette[(3 * i) + 2]; + } + + /* If we have a RAMDAC-specific counterpart, use it... */ + if(sc->gfbc->ramdac_load_cursor_palette) + error = sc->gfbc->ramdac_load_cursor_palette(adp, + &sc->gfbc->cursor_palette); + else + /* Otherwise, use the built-in functionality... */ + error = sc->gfbc->builtin_load_cursor_palette(adp, + &sc->gfbc->cursor_palette); + + return(error); +} + +int +gfb_copy(video_adapter_t *adp, vm_offset_t src, vm_offset_t dst, int n) +{ + int error, num_pixels; + + if(n == 0) + return(0); + num_pixels = adp->va_info.vi_cheight * adp->va_line_width; + error = (*vidsw[adp->va_index]->bitblt)(adp, src * num_pixels, + dst * num_pixels, n * num_pixels); + return(error); +} + +int +gfb_putp(video_adapter_t *adp, vm_offset_t off, u_int32_t p, u_int32_t a, + int size, int bpp, int bit_ltor, int byte_ltor) +{ + int i, j, k, num_shifts; + u_int32_t _p, val[32]; + + if(bpp < 1) + return(-1); + + /* + If we don't display bits right-to-left (little-bitian?), + then perform a bit-swap on p... + */ + if(bit_ltor) { + num_shifts = 8 * size; + for(i = 0, _p = 0; i < num_shifts; i++, p >>= 1) { + _p <<= 1; + _p |= (p & 0x00000001); + } + } else + _p = p; + + switch(bpp) { + /* Accelerate the simplest cases... */ + case 1: + if((a & 0x00000001) == 0) + val[0] = 0; + else if(size <= 0) + val[0] = 0; + else if(size == 1) + val[0] = _p & 0x000000ff; + else if(size == 2) + val[0] = _p & 0x0000ffff; + else if(size == 3) + val[0] = _p & 0x00ffffff; + else if(size == 4) + val[0] = _p & 0xffffffff; + break; + + /* Only do the following if we are not a simple case... */ + case 8: + if(size > 0) { + a &= 0x000000ff; + val[0] = 0; + if(_p & 0x00000001) val[0] |= (a); + if(_p & 0x00000002) val[0] |= (a << 8); + if(_p & 0x00000004) val[0] |= (a << 16); + if(_p & 0x00000008) val[0] |= (a << 24); + val[1] = 0; + if(_p & 0x00000010) val[1] |= (a); + if(_p & 0x00000020) val[1] |= (a << 8); + if(_p & 0x00000040) val[1] |= (a << 16); + if(_p & 0x00000080) val[1] |= (a << 24); + } + if(size > 1) { + val[2] = 0; + if(_p & 0x00000100) val[2] |= (a); + if(_p & 0x00000200) val[2] |= (a << 8); + if(_p & 0x00000400) val[2] |= (a << 16); + if(_p & 0x00000800) val[2] |= (a << 24); + val[3] = 0; + if(_p & 0x00001000) val[3] |= (a); + if(_p & 0x00002000) val[3] |= (a << 8); + if(_p & 0x00004000) val[3] |= (a << 16); + if(_p & 0x00008000) val[3] |= (a << 24); + } + if(size > 2) { + val[4] = 0; + if(_p & 0x00010000) val[4] |= (a); + if(_p & 0x00020000) val[4] |= (a << 8); + if(_p & 0x00040000) val[4] |= (a << 16); + if(_p & 0x00080000) val[4] |= (a << 24); + val[5] = 0; + if(_p & 0x00100000) val[5] |= (a); + if(_p & 0x00200000) val[5] |= (a << 8); + if(_p & 0x00400000) val[5] |= (a << 16); + if(_p & 0x00800080) val[5] |= (a << 24); + } + if(size > 3) { + val[6] = 0; + if(_p & 0x01000000) val[6] |= (a); + if(_p & 0x02000000) val[6] |= (a << 8); + if(_p & 0x04000000) val[6] |= (a << 16); + if(_p & 0x08000000) val[6] |= (a << 24); + val[7] = 0; + if(_p & 0x10000000) val[7] |= (a); + if(_p & 0x20000000) val[7] |= (a << 8); + if(_p & 0x40000000) val[7] |= (a << 16); + if(_p & 0x80000000) val[7] |= (a << 24); + } + break; + case 16: + if(size > 0) { + a &= 0x0000ffff; + if(_p & 0x00000001) val[0] |= (a); + if(_p & 0x00000002) val[0] |= (a << 16); + if(_p & 0x00000004) val[1] |= (a); + if(_p & 0x00000008) val[1] |= (a << 16); + if(_p & 0x00000010) val[2] |= (a); + if(_p & 0x00000020) val[2] |= (a << 16); + if(_p & 0x00000040) val[3] |= (a); + if(_p & 0x00000080) val[3] |= (a << 16); + } + if(size > 1) { + if(_p & 0x00000100) val[4] |= (a); + if(_p & 0x00000200) val[4] |= (a << 16); + if(_p & 0x00000400) val[5] |= (a); + if(_p & 0x00000800) val[5] |= (a << 16); + if(_p & 0x00001000) val[6] |= (a); + if(_p & 0x00002000) val[6] |= (a << 16); + if(_p & 0x00004000) val[7] |= (a); + if(_p & 0x00008000) val[7] |= (a << 16); + } + if(size > 2) { + if(_p & 0x00010000) val[8] |= (a); + if(_p & 0x00020000) val[8] |= (a << 16); + if(_p & 0x00040000) val[9] |= (a); + if(_p & 0x00080000) val[9] |= (a << 16); + if(_p & 0x00100000) val[10] |= (a); + if(_p & 0x00200000) val[10] |= (a << 16); + if(_p & 0x00400000) val[11] |= (a); + if(_p & 0x00800000) val[11] |= (a << 16); + } + if(size > 3) { + if(_p & 0x01000000) val[12] |= (a); + if(_p & 0x02000000) val[12] |= (a << 16); + if(_p & 0x04000000) val[13] |= (a); + if(_p & 0x08000000) val[13] |= (a << 16); + if(_p & 0x10000000) val[14] |= (a); + if(_p & 0x20000000) val[14] |= (a << 16); + if(_p & 0x40000000) val[15] |= (a); + if(_p & 0x80000000) val[15] |= (a << 16); + } + break; + case 32: + if(size > 0) { + a &= 0xffffffff; + if(_p & 0x00000001) val[0] = (a); + if(_p & 0x00000002) val[1] = (a); + if(_p & 0x00000004) val[2] = (a); + if(_p & 0x00000008) val[3] = (a); + if(_p & 0x00000010) val[4] = (a); + if(_p & 0x00000020) val[5] = (a); + if(_p & 0x00000040) val[6] = (a); + if(_p & 0x00000080) val[7] = (a); + } + if(size > 1) { + if(_p & 0x00000100) val[8] = (a); + if(_p & 0x00000200) val[9] = (a); + if(_p & 0x00000400) val[10] = (a); + if(_p & 0x00000800) val[11] = (a); + if(_p & 0x00001000) val[12] = (a); + if(_p & 0x00002000) val[13] = (a); + if(_p & 0x00004000) val[14] = (a); + if(_p & 0x00008000) val[15] = (a); + } + if(size > 2) { + if(_p & 0x00010000) val[16] = (a); + if(_p & 0x00020000) val[17] = (a); + if(_p & 0x00040000) val[18] = (a); + if(_p & 0x00080000) val[19] = (a); + if(_p & 0x00100000) val[20] = (a); + if(_p & 0x00200000) val[21] = (a); + if(_p & 0x00400000) val[22] = (a); + if(_p & 0x00800000) val[23] = (a); + } + if(size > 3) { + if(_p & 0x01000000) val[24] = (a); + if(_p & 0x02000000) val[25] = (a); + if(_p & 0x04000000) val[26] = (a); + if(_p & 0x08000000) val[27] = (a); + if(_p & 0x10000000) val[28] = (a); + if(_p & 0x20000000) val[29] = (a); + if(_p & 0x40000000) val[30] = (a); + if(_p & 0x80000000) val[31] = (a); + } + break; + default: + break; + } + j = (bpp == 1) ? 1 : bpp * size / sizeof(u_int32_t); + + /* + If we don't display bytes right-to-left (little-endian), + then perform a byte-swap on p (we don't have to swap if + bpp == 1 and val[0] == 0)... + */ + if((byte_ltor) && (j > 1) && (val[j] != 0)) { + for(i = 0; i < (j - i); i++) { + _p = val[j - i]; + val[j - i] = val[i]; + val[i] = _p; + } + for(i = 0; i < j; i++) { + _p = val[i]; + for(k = 0, val[i] = 0; k < sizeof(u_int32_t); + k++, _p >>= 8) { + val[i] <<= 8; + val[i] |= (_p & 0xff); + } + } + } + + for(i = 0; i < j; i++) { + /* Write the pixel-row... */ + WRITE_GFB_BUFFER(adp, (off + i), val[i]); + } + return(0); +} + +int +gfb_putc(video_adapter_t *adp, vm_offset_t off, u_int8_t c, u_int8_t a) +{ + vm_offset_t poff; + struct gfb_softc *sc; + int i, pixel_size; + u_int row, col; + u_int8_t *pixel; + + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + pixel_size = adp->va_info.vi_depth / 8; + + /* Get the start of the array of pixels rows for this character... */ + pixel = sc->gfbc->font + (c * adp->va_info.vi_cheight); + + /* Calculate the new cursor position... */ + row = off / adp->va_info.vi_width; + col = off % adp->va_info.vi_width; + + /* Iterate over all the pixel rows for this character... */ + for(i = 0; i < adp->va_info.vi_cheight; i++) { + /* Get the address of the character's pixel-row... */ + poff = ((col * adp->va_info.vi_cwidth * pixel_size) + + (((row * adp->va_info.vi_cheight) + i) * + adp->va_line_width)) / sizeof(u_int32_t); + + /* Now display the current pixel row... */ + (*vidsw[adp->va_index]->putp)(adp, poff, pixel[i], a, + sizeof(u_int8_t), 1, 1, 0); + } + return(0); +} + +int +gfb_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len) +{ + struct gfb_softc *sc; + int i; + + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* If the string in empty, just return now... */ + if(len == 0) + return(0); + + for(i = 0; i < len; i++) + (*vidsw[adp->va_index]->putc)(adp, off + i, s[i] & 0x00ff, + (s[i] & 0xff00) >> 8); + + return(0); +} + +int +gfb_putm(video_adapter_t *adp, int x, int y, u_int8_t *pixel_image, + u_int32_t pixel_mask, int size) +{ + vm_offset_t poff; + int i, pixel_size; + + pixel_size = adp->va_info.vi_depth / 8; + + /* Iterate over all the pixel rows for the mouse pointer... */ + for(i = 0; i < size; i++) { + /* Get the address of the mouse pointer's pixel-row... */ + poff = ((x * pixel_size) + ((y + i) * adp->va_line_width)) / + sizeof(u_int32_t); + /* Now display the current pixel-row... */ + (*vidsw[adp->va_index]->putp)(adp, poff, pixel_image[i], + pixel_mask, sizeof(u_int8_t), 1, 1, 0); + } + + return(0); +} + +int +gfb_error(void) +{ + + return(0); +} diff --git a/sys/dev/fb/gfb.h b/sys/dev/fb/gfb.h new file mode 100644 index 0000000..07ee5c9 --- /dev/null +++ b/sys/dev/fb/gfb.h @@ -0,0 +1,172 @@ +/* + * Copyright (c) 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + * + * Copyright (c) 2000 Andrew Miklic + * + * $FreeBSD$ + */ + +#ifndef _FB_GFB_H_ +#define _FB_GFB_H_ + +#define MAX_NUM_GFB_CARDS 16 + +#define GFB_UNIT(dev) minor(dev) +#define GFB_MKMINOR(unit) (unit) +#define BIT_REVERSE(byte) \ + ((((byte) & 0x01) << 7) | \ + (((byte) & 0x02) << 5) | \ + (((byte) & 0x04) << 3) | \ + (((byte) & 0x08) << 1) | \ + (((byte) & 0x10) >> 1) | \ + (((byte) & 0x20) >> 3) | \ + (((byte) & 0x40) >> 5) | \ + (((byte) & 0x80) >> 7)) +#define probe_done(adp) ((adp)->va_flags & V_ADP_PROBED) +#define init_done(adp) ((adp)->va_flags & V_ADP_INITIALIZED) +#define config_done(adp) ((adp)->va_flags & V_ADP_REGISTERED) + +struct gfb_softc; + +int gfb_error(void); +vi_probe_t gfb_probe; +vi_init_t gfb_init; + +vi_get_info_t gfb_get_info; +/*vi_query_mode_t gfb_query_mode;*/ +vi_set_mode_t gfb_set_mode; +vi_save_font_t gfb_save_font; +vi_load_font_t gfb_load_font; +vi_show_font_t gfb_show_font; +vi_save_palette_t gfb_save_palette; +vi_load_palette_t gfb_load_palette; +vi_save_state_t gfb_save_state; +vi_load_state_t gfb_load_state; +vi_read_hw_cursor_t gfb_read_hw_cursor; +vi_set_hw_cursor_t gfb_set_hw_cursor; +vi_set_hw_cursor_shape_t gfb_set_hw_cursor_shape; +vi_mmap_t gfb_mmap; +vi_ioctl_t gfb_ioctl; +vi_set_border_t gfb_set_border; +vi_set_win_org_t gfb_set_win_org; +vi_fill_rect_t gfb_fill_rect; +vi_bitblt_t gfb_bitblt; +vi_clear_t gfb_clear; +vi_diag_t gfb_diag; +vi_save_cursor_palette_t gfb_save_cursor_palette; +vi_load_cursor_palette_t gfb_load_cursor_palette; +vi_copy_t gfb_copy; +vi_putp_t gfb_putp; +vi_putc_t gfb_putc; +vi_puts_t gfb_puts; +vi_putm_t gfb_putm; + +typedef void gfb_ramdac_init_t(struct gfb_softc *); +typedef u_int8_t gfb_ramdac_rd_t(struct gfb_softc *, u_int); +typedef void gfb_ramdac_wr_t(struct gfb_softc *, u_int, u_int8_t); +typedef void gfb_ramdac_intr_t(struct gfb_softc *); +typedef int gfb_ramdac_save_palette_t(video_adapter_t *, video_color_palette_t *); +typedef int gfb_ramdac_load_palette_t(video_adapter_t *, video_color_palette_t *); +typedef int gfb_ramdac_save_cursor_palette_t(video_adapter_t *, struct fbcmap *); +typedef int gfb_ramdac_load_cursor_palette_t(video_adapter_t *, struct fbcmap *); +typedef int gfb_ramdac_read_hw_cursor_t(video_adapter_t *, int *, int *); +typedef int gfb_ramdac_set_hw_cursor_t(video_adapter_t *, int, int); +typedef int gfb_ramdac_set_hw_cursor_shape_t(video_adapter_t *, int, int, int, int); +typedef int gfb_builtin_save_palette_t(video_adapter_t *, video_color_palette_t *); +typedef int gfb_builtin_load_palette_t(video_adapter_t *, video_color_palette_t *); +typedef int gfb_builtin_save_cursor_palette_t(video_adapter_t *, struct fbcmap *); +typedef int gfb_builtin_load_cursor_palette_t(video_adapter_t *, struct fbcmap *); +typedef int gfb_builtin_read_hw_cursor_t(video_adapter_t *, int *, int *); +typedef int gfb_builtin_set_hw_cursor_t(video_adapter_t *, int, int); +typedef int gfb_builtin_set_hw_cursor_shape_t(video_adapter_t *, int, int, int, int); + +struct monitor { + u_int16_t cols; /* Columns */ + u_int16_t hfp; /* Horizontal Front Porch */ + u_int16_t hsync; /* Horizontal Sync */ + u_int16_t hbp; /* Horizontal Back Porch */ + u_int16_t rows; /* Rows */ + u_int16_t vfp; /* Vertical Front Porch */ + u_int16_t vsync; /* Vertical Sync */ + u_int16_t vbp; /* Vertical Back Porch */ + u_int32_t dotclock; /* Dot Clock */ +}; + +struct gfb_font { + int width; + int height; + u_char data[256 * 32]; +}; + +struct gfb_conf { + char *name; /* name for this board type */ + char *ramdac_name; /* name for this RAMDAC */ + u_char *font; + struct gfb_font fonts[4]; + video_color_palette_t palette; + struct fbcmap cursor_palette; + gfb_ramdac_init_t *ramdac_init; + gfb_ramdac_rd_t *ramdac_rd; + gfb_ramdac_wr_t *ramdac_wr; + gfb_ramdac_intr_t *ramdac_intr; + gfb_ramdac_save_palette_t *ramdac_save_palette; + gfb_ramdac_load_palette_t *ramdac_load_palette; + gfb_ramdac_save_cursor_palette_t *ramdac_save_cursor_palette; + gfb_ramdac_load_cursor_palette_t *ramdac_load_cursor_palette; + gfb_ramdac_read_hw_cursor_t *ramdac_read_hw_cursor; + gfb_ramdac_set_hw_cursor_t *ramdac_set_hw_cursor; + gfb_ramdac_set_hw_cursor_shape_t *ramdac_set_hw_cursor_shape; + gfb_builtin_save_palette_t *builtin_save_palette; + gfb_builtin_load_palette_t *builtin_load_palette; + gfb_builtin_save_cursor_palette_t *builtin_save_cursor_palette; + gfb_builtin_load_cursor_palette_t *builtin_load_cursor_palette; + gfb_builtin_read_hw_cursor_t *builtin_read_hw_cursor; + gfb_builtin_set_hw_cursor_t *builtin_set_hw_cursor; + gfb_builtin_set_hw_cursor_shape_t *builtin_set_hw_cursor_shape; +}; + +struct video_adapter; +struct genfb_softc; + +typedef struct gfb_softc { + char *driver_name; /* name for this driver */ + struct video_adapter *adp; + struct genfb_softc *gensc; + struct gfb_conf *gfbc; + bus_space_handle_t bhandle; + bus_space_tag_t btag; + bus_space_handle_t regs; + void *intrhand; + struct resource *irq; + struct resource *res; + u_int8_t rev; /* GFB revision */ + int type; + int model; + struct cdevsw *cdevsw; + dev_t devt; +} *gfb_softc_t; + +#endif /* _FB_GFB_H_ */ diff --git a/sys/dev/fb/tga.c b/sys/dev/fb/tga.c new file mode 100644 index 0000000..08fcac8 --- /dev/null +++ b/sys/dev/fb/tga.c @@ -0,0 +1,2431 @@ +/*- + * Copyright (c) 2000, 2001 Andrew Miklic, Andrew Gallatin, Peter Jeremy, + * and Thomas V. Crimi + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* + * Copyright (c) 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <machine/stdarg.h> + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/conf.h> +#include <sys/proc.h> +#include <sys/fcntl.h> +#include <sys/malloc.h> +#include <sys/fbio.h> +#include <sys/consio.h> + +#include <isa/isareg.h> +#include <dev/fb/vgareg.h> + +#include <vm/vm.h> +#include <vm/vm_param.h> +#include <vm/pmap.h> + +#include <machine/md_var.h> +#include <machine/pc/bios.h> +#include <machine/clock.h> +#include <machine/bus_memio.h> +#include <machine/bus.h> +#include <machine/pc/vesa.h> +#include <machine/resource.h> +#include <machine/rpb.h> + +#include <sys/bus.h> +#include <sys/rman.h> + +#include <pci/pcireg.h> +#include <pci/pcivar.h> + +#include <dev/fb/fbreg.h> +#include <dev/syscons/syscons.h> +#include <dev/fb/gfb.h> +#include <dev/gfb/gfb_pci.h> +#include <dev/fb/tga.h> +#include <dev/tga/tga_pci.h> + +#include "opt_fb.h" + +/* TGA-specific FB video driver function declarations */ +static int tga_error(void); +static vi_init_t tga_init; +static void tga2_init(struct gfb_softc *, int); + +/* TGA-specific functionality. */ +static gfb_builtin_save_palette_t tga_builtin_save_palette; +static gfb_builtin_load_palette_t tga_builtin_load_palette; +static gfb_builtin_save_palette_t tga2_builtin_save_palette; +static gfb_builtin_load_palette_t tga2_builtin_load_palette; +static gfb_builtin_save_cursor_palette_t tga2_builtin_save_cursor_palette; +static gfb_builtin_load_cursor_palette_t tga2_builtin_load_cursor_palette; +static gfb_builtin_read_hw_cursor_t tga_builtin_read_hw_cursor; +static gfb_builtin_set_hw_cursor_t tga_builtin_set_hw_cursor; +static gfb_builtin_set_hw_cursor_shape_t tga_builtin_set_hw_cursor_shape; +static void bt463_load_palette_intr(struct gfb_softc *); +static void bt463_load_cursor_palette_intr(struct gfb_softc *); +static int tga_schedule_intr(struct gfb_softc *, void (*)(struct gfb_softc *)); + +/* RAMDAC interface functions */ +static gfb_ramdac_wr_t tga_bt485_wr; +static gfb_ramdac_rd_t tga_bt485_rd; +static gfb_ramdac_wr_t tga_bt463_wr; +static gfb_ramdac_rd_t tga_bt463_rd; +static gfb_ramdac_wr_t tga2_ibm561_wr; +static gfb_ramdac_rd_t tga2_ibm561_rd; +static void tga2_ics9110_wr(struct gfb_softc *, int); + +/* RAMDAC-specific functions */ +static gfb_ramdac_init_t bt463_init; +static void bt463_update_window_type(struct gfb_softc *); +static gfb_ramdac_save_palette_t bt463_save_palette; +static gfb_ramdac_load_palette_t bt463_load_palette; +static gfb_ramdac_save_cursor_palette_t bt463_save_cursor_palette; +static gfb_ramdac_load_cursor_palette_t bt463_load_cursor_palette; +static gfb_ramdac_init_t bt485_init; +static gfb_ramdac_save_palette_t bt485_save_palette; +static gfb_ramdac_load_palette_t bt485_load_palette; +static gfb_ramdac_save_cursor_palette_t bt485_save_cursor_palette; +static gfb_ramdac_load_cursor_palette_t bt485_load_cursor_palette; +static gfb_ramdac_read_hw_cursor_t bt485_read_hw_cursor; +static gfb_ramdac_set_hw_cursor_t bt485_set_hw_cursor; +static gfb_ramdac_set_hw_cursor_shape_t bt485_set_hw_cursor_shape; +static gfb_ramdac_init_t ibm561_init; +static gfb_ramdac_save_palette_t ibm561_save_palette; +static gfb_ramdac_load_palette_t ibm561_load_palette; +static gfb_ramdac_save_cursor_palette_t ibm561_save_cursor_palette; +static gfb_ramdac_load_cursor_palette_t ibm561_load_cursor_palette; + +/* Video Driver-generic functions */ +static vi_query_mode_t tga_query_mode; +static vi_set_mode_t tga_set_mode; +static vi_blank_display_t tga_blank_display; +static vi_ioctl_t tga_ioctl; +static vi_set_border_t tga_set_border; +static vi_set_win_org_t tga_set_win_org; +static vi_fill_rect_t tga_fill_rect; +static vi_bitblt_t tga_bitblt; +static vi_clear_t tga_clear; +static vi_putc_t tga_putc; +static vi_puts_t tga_puts; +static vi_putm_t tga_putm; + +static video_switch_t tgavidsw = { + gfb_probe, + tga_init, + gfb_get_info, + tga_query_mode, + tga_set_mode, + gfb_save_font, + gfb_load_font, + gfb_show_font, + gfb_save_palette, + gfb_load_palette, + tga_set_border, + gfb_save_state, + gfb_load_state, + tga_set_win_org, + gfb_read_hw_cursor, + gfb_set_hw_cursor, + gfb_set_hw_cursor_shape, + tga_blank_display, + gfb_mmap, + gfb_ioctl, + tga_clear, + tga_fill_rect, + tga_bitblt, + tga_error, + tga_error, + gfb_diag, + gfb_save_cursor_palette, + gfb_load_cursor_palette, + gfb_copy, + gfb_putp, + tga_putc, + tga_puts, + tga_putm, +}; + +VIDEO_DRIVER(tga, tgavidsw, NULL); + +extern sc_rndr_sw_t txtrndrsw; +RENDERER(tga, 0, txtrndrsw, gfb_set); + +#ifdef SC_PIXEL_MODE +extern sc_rndr_sw_t gfbrndrsw; +RENDERER(tga, PIXEL_MODE, gfbrndrsw, gfb_set); +#endif /* SC_PIXEL_MODE */ + +#ifndef SC_NO_MODE_CHANGE +extern sc_rndr_sw_t grrndrsw; +RENDERER(tga, GRAPHICS_MODE, grrndrsw, gfb_set); +#endif /* SC_NO_MODE_CHANGE */ + +RENDERER_MODULE(tga, gfb_set); + +#define MHz * 1000000 +#define KHz * 1000 + +extern struct gfb_softc *gfb_device_softcs[2][MAX_NUM_GFB_CARDS]; + +/* + The following 3 variables exist only because we need statically + allocated structures very early in boot to support tga_configure()... +*/ +extern struct gfb_softc console; +extern video_adapter_t console_adp; +extern struct gfb_conf console_gfbc; +extern u_char console_palette_red[256]; +extern u_char console_palette_green[256]; +extern u_char console_palette_blue[256]; +extern u_char console_cursor_palette_red[3]; +extern u_char console_cursor_palette_green[3]; +extern u_char console_cursor_palette_blue[3]; + +static struct monitor decmonitors[] = { + /* 0x0: 1280 x 1024 @ 72Hz */ + { 1280, 32, 160, 232, + 1024, 3, 3, 33, + 130808 KHz }, + + /* 0x1: 1280 x 1024 @ 66Hz */ + { 1280, 32, 160, 232, + 1024, 3, 3, 33, + 119840 KHz }, + + /* 0x2: 1280 x 1024 @ 60Hz */ + { 1280, 44, 184, 200, + 1024, 3, 3, 26, + 108180 KHz }, + + /* 0x3: 1152 x 900 @ 72Hz */ + { 1152, 64, 112, 176, + 900, 6, 10, 44, + 103994 KHz }, + + /* 0x4: 1600 x 1200 @ 65Hz */ + { 1600, 32, 192, 336, + 1200, 1, 3, 46, + 175 MHz }, + + /* 0x5: 1024 x 768 @ 70Hz */ + { 1024, 24, 136, 144, + 768, 3, 6, 29, + 75 MHz }, + + /* 0x6: 1024 x 768 @ 72Hz */ + { 1024, 16, 128, 128, + 768, 1, 6, 22, + 74 MHz }, + + /* 0x7: 1024 x 864 @ 60Hz */ + { 1024, 12, 128, 116, + 864, 0, 3, 34, + 69 MHz }, + + /* 0x8: 1024 x 768 @ 60Hz */ + { 1024, 56, 64, 200, + 768, 7, 9, 26, + 65 MHz }, + + /* 0x9: 800 x 600 @ 72Hz */ + { 800, 56, 120, 64, + 600, 37, 6, 23, + 50 MHz }, + + /* 0xa: 800 x 600 @ 60Hz */ + { 800, 40, 128, 88, + 600, 1, 4, 23, + 40 MHz }, + + /* 0xb: 640 x 480 @ 72Hz */ + { 640, 24, 40, 128, + 480, 9, 3, 28, + 31500 KHz }, + + /* 0xc: 640 x 480 @ 60Hz */ + { 640, 16, 96, 48, + 480, 10, 2, 33, + 25175 KHz }, + + /* 0xd: 1280 x 1024 @ 75Hz */ + { 1280, 16, 144, 248, + 1024, 1, 3, 38, + 135 MHz }, + + /* 0xe: 1280 x 1024 @ 60Hz */ + { 1280, 19, 163, 234, + 1024, 6, 7, 44, + 110 MHz }, + + /* 0xf: 1600 x 1200 @ 75Hz */ + /* XXX -- this one's weird. rcd */ + { 1600, 32, 192, 336, + 1200, 1, 3, 46, + 202500 KHz } +}; + +#undef MHz +#undef KHz + +#undef KB +#define KB * 1024 +#undef MB +#define MB * 1024 * 1024 + +/* + * These are the 16 default VGA colors--these are replicated 16 times as the + * initial (default) color-map. The text rendering functions use entries + * 0..15 for normal foreground/background colors. The entries 128..255 are + * used for blinking entries--when "on," they contain the foreground color + * entries; when "off," they contain the background color entries... + */ +static const struct cmap { + u_char red; + u_char green; + u_char blue; +} default_cmap[16] = { + {0x00, 0x00, 0x00}, /* Black */ + {0x00, 0x00, 0xff}, /* Blue */ + {0x00, 0xff, 0x00}, /* Green */ + {0x00, 0xc0, 0xc0}, /* Cyan */ + {0xff, 0x00, 0x00}, /* Red */ + {0xc0, 0x00, 0xc0}, /* Magenta */ + {0xc0, 0xc0, 0x00}, /* Brown */ + {0xc0, 0xc0, 0xc0}, /* Light Grey */ + {0x80, 0x80, 0x80}, /* Dark Grey */ + {0x80, 0x80, 0xff}, /* Light Blue */ + {0x80, 0xff, 0x80}, /* Light Green */ + {0x80, 0xff, 0xff}, /* Light Cyan */ + {0xff, 0x80, 0x80}, /* Light Red */ + {0xff, 0x80, 0xff}, /* Light Magenta */ + {0xff, 0xff, 0x80}, /* Yellow */ + {0xff, 0xff, 0xff} /* White */ +}; + +extern struct gfb_font bold8x16; + +/***************************************************************************** + * + * FB-generic functions + * + ****************************************************************************/ + +static int +tga_init(int unit, video_adapter_t *adp, int flags) +{ + struct gfb_softc *sc; + struct gfb_conf *gfbc; + unsigned int monitor; + int card_type; + int gder; + int deep; + int addrmask; + int cs; + int error; + gfb_reg_t ccbr; + + /* Assume the best... */ + error = 0; + + sc = gfb_device_softcs[adp->va_model][unit]; + gfbc = sc->gfbc; + + /* Initialize palette counts... */ + gfbc->palette.count = 256; + gfbc->cursor_palette.count = 3; + + /* Initialize the adapter... */ + gder = BASIC_READ_TGA_REGISTER(adp, TGA_REG_GDER); + addrmask = (gder & GDER_ADDR_MASK) >> GDER_ADDR_SHIFT; + deep = (gder & GDER_DEEP) != 0; + cs = (gder & GDER_CS) == 0; + card_type = TGA_TYPE_UNKNOWN; + adp->va_little_bitian = 1; + adp->va_little_endian = 0; + adp->va_initial_mode = 0; + adp->va_initial_bios_mode = 0; + adp->va_mode = 0; + adp->va_info.vi_mem_model = V_INFO_MM_TEXT; + adp->va_info.vi_mode = M_VGA_M80x30; + adp->va_info.vi_flags = V_INFO_COLOR; + adp->va_buffer = adp->va_mem_base; + adp->va_buffer_size = 4 MB * (1 + addrmask); + adp->va_registers = adp->va_buffer + TGA_REG_SPACE_OFFSET; + adp->va_registers_size = 2 KB; + adp->va_window = adp->va_buffer + (adp->va_buffer_size / 2); + adp->va_info.vi_window = vtophys(adp->va_window); + adp->va_window_size = (deep ? 4 MB : 2 MB); + adp->va_info.vi_window_size = adp->va_window_size; + adp->va_window_gran = adp->va_window_size; + adp->va_info.vi_window_gran = adp->va_window_gran; + adp->va_info.vi_buffer = vtophys(adp->va_buffer); + adp->va_info.vi_buffer_size = adp->va_buffer_size; + adp->va_disp_start.x = 0; + adp->va_disp_start.y = 0; + adp->va_info.vi_depth = (deep ? 32 : 8); + adp->va_info.vi_planes = adp->va_info.vi_depth / 8; + adp->va_info.vi_width = (READ_GFB_REGISTER(adp, TGA_REG_VHCR) & + VHCR_ACTIVE_MASK); + adp->va_info.vi_width |= (READ_GFB_REGISTER(adp, TGA_REG_VHCR) & + 0x30000000) >> 19; + switch(adp->va_info.vi_width) { + case 0: + adp->va_info.vi_width = 8192; + break; + case 1: + adp->va_info.vi_width = 8196; + break; + default: + adp->va_info.vi_width *= 4; + break; + } + adp->va_info.vi_height = (READ_GFB_REGISTER(adp, TGA_REG_VVCR) & + VVCR_ACTIVE_MASK); + adp->va_line_width = adp->va_info.vi_width * adp->va_info.vi_depth / 8; + if(READ_GFB_REGISTER(adp, TGA_REG_VHCR) & VHCR_ODD) + adp->va_info.vi_width -= 4; + + /* + Set the video base address and the cursor base address to + something known such that the video base address is at + least 1 KB past the cursor base address (the cursor is 1 KB + in size, so leave room for it)...we pick 4 KB and 0 KB, + respectively, since they begin at the top of the framebuffer + for minimal fragmentation of the address space, and this will + always leave enough room for the cursor for all implementations... + */ + + /* Set the video base address... */ + tga_set_win_org(sc->adp, 4 KB); + + /* Set the cursor base address... */ + ccbr = READ_GFB_REGISTER(sc->adp, TGA_REG_CCBR); + ccbr = (ccbr & 0xfffffc0f) | (0 << 4); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_CCBR, ccbr); + + /* Type the card... */ + if(adp->va_type == KD_TGA) { + if(!deep) { + + /* 8bpp frame buffer */ + gfbc->ramdac_name = "BT485"; + gfbc->ramdac_init = bt485_init; + gfbc->ramdac_rd = tga_bt485_rd; + gfbc->ramdac_wr = tga_bt485_wr; + gfbc->ramdac_save_palette = bt485_save_palette; + gfbc->ramdac_load_palette = bt485_load_palette; + gfbc->ramdac_save_cursor_palette = + bt485_save_cursor_palette; + gfbc->ramdac_load_cursor_palette = + bt485_load_cursor_palette; + gfbc->ramdac_read_hw_cursor = bt485_read_hw_cursor; + gfbc->ramdac_set_hw_cursor = bt485_set_hw_cursor; + gfbc->ramdac_set_hw_cursor_shape = + bt485_set_hw_cursor_shape; + + if(addrmask == GDER_ADDR_4MB) { + + /* 4MB core map; T8-01 or T8-02 */ + if(!cs) { + card_type = TGA_TYPE_T8_01; + gfbc->name = "T8-01"; + } else { + card_type = TGA_TYPE_T8_02; + gfbc->name = "T8-02"; + } + } else if(addrmask == GDER_ADDR_8MB) { + + /* 8MB core map; T8-22 */ + if(cs) {/* sanity */ + card_type = TGA_TYPE_T8_22; + gfbc->name = "T8-22"; + } + } else if(addrmask == GDER_ADDR_16MB) { + + /* 16MB core map; T8-44 */ + if(cs) {/* sanity */ + card_type = TGA_TYPE_T8_44; + gfbc->name = "T8-44"; + } + } else if(addrmask == GDER_ADDR_32MB) { + + /* 32MB core map; ??? */ + card_type = TGA_TYPE_UNKNOWN; + } + } else { + + /* 32bpp frame buffer */ + gfbc->ramdac_name = "BT463"; + gfbc->ramdac_init = bt463_init; + gfbc->ramdac_rd = tga_bt463_rd; + gfbc->ramdac_wr = tga_bt463_wr; + gfbc->builtin_save_palette = tga_builtin_save_palette; + gfbc->builtin_load_palette = tga_builtin_load_palette; + gfbc->ramdac_save_cursor_palette = + bt463_save_cursor_palette; + gfbc->ramdac_load_cursor_palette = + bt463_load_cursor_palette; + gfbc->builtin_read_hw_cursor = + tga_builtin_read_hw_cursor; + gfbc->builtin_set_hw_cursor = tga_builtin_set_hw_cursor; + gfbc->builtin_set_hw_cursor_shape = + tga_builtin_set_hw_cursor_shape; + + /* 32bpp frame buffer */ + if(addrmask == GDER_ADDR_4MB) { + + /* 4MB core map; ??? */ + card_type = TGA_TYPE_UNKNOWN; + } else if(addrmask == GDER_ADDR_8MB) { + + /* 8MB core map; ??? */ + card_type = TGA_TYPE_UNKNOWN; + } else if(addrmask == GDER_ADDR_16MB) { + + /* 16MB core map; T32-04 or T32-08 */ + if(!cs) { + card_type = TGA_TYPE_T32_04; + gfbc->name = "T32-04"; + } else { + card_type = TGA_TYPE_T32_08; + gfbc->name = "T32-08"; + } + } else if(addrmask == GDER_ADDR_32MB) { + + /* 32MB core map; T32-88 */ + if(cs) {/* sanity */ + card_type = TGA_TYPE_T32_88; + gfbc->name = "T32-88"; + } + } + } + } + else if(adp->va_type == KD_TGA2) { + gfbc->ramdac_name = "IBM561"; + gfbc->ramdac_init = ibm561_init; + gfbc->ramdac_rd = tga2_ibm561_rd; + gfbc->ramdac_wr = tga2_ibm561_wr; + gfbc->ramdac_save_palette = ibm561_save_palette; + gfbc->ramdac_load_palette = ibm561_load_palette; + gfbc->ramdac_save_cursor_palette = ibm561_save_cursor_palette; + gfbc->ramdac_load_cursor_palette = ibm561_load_cursor_palette; + gfbc->builtin_read_hw_cursor = tga_builtin_read_hw_cursor; + gfbc->builtin_set_hw_cursor = tga_builtin_set_hw_cursor; + gfbc->builtin_set_hw_cursor_shape = + tga_builtin_set_hw_cursor_shape; + + /* 4MB core map */ + if(addrmask == GDER_ADDR_4MB) + card_type = TGA_TYPE_UNKNOWN; + + /* 8MB core map */ + else if(addrmask == GDER_ADDR_8MB) { + card_type = TGA2_TYPE_3D30; + gfbc->name = "3D30"; + } + + /* 16MB core map */ + else if(addrmask == GDER_ADDR_16MB) { + card_type = TGA2_TYPE_4D20; + gfbc->name = "4D20"; + } + else if(addrmask == GDER_ADDR_32MB) + card_type = TGA_TYPE_UNKNOWN; + } + + /* + For now, just return for TGA2 cards (i.e., + allow syscons to treat this device as a normal + VGA device, and don't do anything TGA2-specific, + e.g., only use the TGA2 card in VGA mode for now + as opposed to 2DA mode... + */ + if(adp->va_type == KD_TGA2) + return(error); + + /* If we couldn't identify the card, err-out... */ + if(card_type == TGA_TYPE_UNKNOWN) { + printf("tga%d: Unknown TGA type\n", unit); + error = ENODEV; + goto done; + } + + /* Clear and disable interrupts... */ + WRITE_GFB_REGISTER(adp, TGA_REG_SISR, 0x00000001); + + /* Perform TGA2-specific initialization, if necessary... */ + if(adp->va_type == KD_TGA2) { + monitor = (~READ_GFB_REGISTER(adp, TGA_REG_GREV) >> 16 ) & 0x0f; + tga2_init(sc, monitor); + } +done: + return(error); +} + +static void +tga2_init(sc, monitor) + struct gfb_softc *sc; + int monitor; +{ + return; + tga2_ics9110_wr(sc, decmonitors[monitor].dotclock); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_VHCR, + ((decmonitors[monitor].hbp / 4) << VHCR_BPORCH_SHIFT) | + ((decmonitors[monitor].hsync / 4) << VHCR_HSYNC_SHIFT) | + (((decmonitors[monitor].hfp) / 4) << VHCR_FPORCH_SHIFT) | + ((decmonitors[monitor].cols) / 4)); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_VVCR, + (decmonitors[monitor].vbp << VVCR_BPORCH_SHIFT) | + (decmonitors[monitor].vsync << VVCR_VSYNC_SHIFT) | + (decmonitors[monitor].vfp << VVCR_FPORCH_SHIFT) | + (decmonitors[monitor].rows)); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_VVBR, 1); + GFB_REGISTER_READWRITE_BARRIER(sc, TGA_REG_VHCR, 3); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_VVVR, + READ_GFB_REGISTER(sc->adp, TGA_REG_VVVR) | 1); + GFB_REGISTER_READWRITE_BARRIER(sc, TGA_REG_VVVR, 1); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_GPMR, 0xffffffff); + GFB_REGISTER_READWRITE_BARRIER(sc, TGA_REG_GPMR, 1); +} + +static int +tga_query_mode(video_adapter_t *adp, video_info_t *info) +{ + int error; + + /* Assume the best... */ + error = 0; + + /* Verify that this mode is supported on this adapter... */ + if(adp->va_type == KD_TGA2) { + if((info->vi_mode != TGA2_2DA_MODE) && + (info->vi_mode != TGA2_VGA_MODE)) + error = ENODEV; + } + else { + if(info->vi_mode != 0) + error = ENODEV; + } + return(error); +} + +static int +tga_set_mode(video_adapter_t *adp, int mode) +{ + int error; + gfb_reg_t gder; + gfb_reg_t vgae_mask; + + /* Assume the best... */ + error = 0; + + gder = READ_GFB_REGISTER(video_adapter_t *adp, TGA_REG_GDER); + + /* + Determine the adapter type first + so we know which modes are valid for it... + */ + switch(adp->va_type) { + case KD_TGA2: + + /* + Verify that this mode is supported + on this adapter... + */ + switch(mode) { + case TGA2_2DA_MODE: + vgae_mask = ~0x00400000; + WRITE_GFB_REGISTER(video_adapter_t *adp, TGA_REG_GDER, + gder & vgae_mask); + adp->va_mode = mode; + break; + case TGA2_VGA_MODE: + vgae_mask = 0x00400000; + WRITE_GFB_REGISTER(video_adapter_t *adp, TGA_REG_GDER, + gder | vgae_mask); + adp->va_mode = mode; + break; + default: + error = ENODEV; + } + break; + case KD_TGA: + + /* + Verify that this mode is supported + on this adapter... + */ + switch(mode) { + case 0: + break; + default: + error = ENXIO; + } + break; + default: + error = ENODEV; + } + return(error); +} + +static int +tga_blank_display(video_adapter_t *adp, int mode) +{ + gfb_reg_t blanked; + int error; + + /* Assume the best... */ + error = 0; + + blanked = READ_GFB_REGISTER(adp, TGA_REG_VVVR) & + (VVR_BLANK | VVR_VIDEOVALID | VVR_CURSOR); + + /* If we're not already blanked, then blank...*/ + switch(mode) { + case V_DISPLAY_BLANK: + if(blanked != (VVR_VIDEOVALID | VVR_BLANK)) { + blanked = VVR_VIDEOVALID | VVR_BLANK; + WRITE_GFB_REGISTER(adp, TGA_REG_VVVR, blanked); + } + break; + case V_DISPLAY_STAND_BY: + if(blanked != VVR_BLANK) { + blanked = VVR_BLANK; + WRITE_GFB_REGISTER(adp, TGA_REG_VVVR, blanked); + } + break; + case V_DISPLAY_ON: + if(blanked != (VVR_VIDEOVALID | VVR_CURSOR)) { + blanked = VVR_VIDEOVALID | VVR_CURSOR; + WRITE_GFB_REGISTER(adp, TGA_REG_VVVR, blanked); + } + break; + default: + break; + } + return(0); +} + +static int +tga_ioctl(video_adapter_t *adp, u_long cmd, caddr_t arg) +{ + struct gfb_softc *sc; + int error; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + switch (cmd) { + case FBIOPUTCMAP: +#if 0 + tga_schedule_intr(sc, bt463_load_palette_intr); + break; +#endif + case FBIO_GETWINORG: + case FBIO_SETWINORG: + case FBIO_SETDISPSTART: + case FBIO_SETLINEWIDTH: + case FBIO_GETPALETTE: + case FBIOGTYPE: + case FBIOGETCMAP: + default: + error = fb_commonioctl(adp, cmd, arg); + } + return(error); +} + +static int +tga_set_border(video_adapter_t *adp, int color) { + return(ENODEV); +} + +static int +tga_set_win_org(video_adapter_t *adp, off_t offset) { + gfb_reg_t vvbr; + u_int16_t window_orig; + int gder; + int deep; + int cs; + + /* Get the adapter's parameters... */ + gder = BASIC_READ_TGA_REGISTER(adp, TGA_REG_GDER); + deep = (gder & 0x1) != 0; + cs = (gder & 0x200) == 0; + + /* + Set the window (framebuffer) origin according to the video + base address... + */ + window_orig = offset / ((1 + cs) * (1 + deep) * (1 + deep) * 2 KB); + adp->va_window_orig = window_orig * ((1 + cs) * (1 + deep) * + (1 + deep) * 2 KB); + + /* Set the video base address... */ + vvbr = READ_GFB_REGISTER(adp, TGA_REG_VVBR); + vvbr = (vvbr & 0xfffffe00) | window_orig; + WRITE_GFB_REGISTER(adp, TGA_REG_VVBR, vvbr); + return(0); +} + +static int +tga_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy) { + int off; + gfb_reg_t gpxr; + gfb_reg_t gmor; + gfb_reg_t gbcr0; + gfb_reg_t gbcr1; + gfb_reg_t color; + + /* Save the pixel mode... */ + gmor = READ_GFB_REGISTER(adp, TGA_REG_GMOR); + + /* Save the pixel mask... */ + gpxr = READ_GFB_REGISTER(adp, TGA_REG_GPXR_P); + + /* Save the block-color... */ + gbcr0 = READ_GFB_REGISTER(adp, TGA_REG_GBCR0); + gbcr1 = READ_GFB_REGISTER(adp, TGA_REG_GBCR1); + + /* Set the pixel mode (block-fill)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GMOR, + (gmor & ~GMOR_MODE_MASK) | GMOR_MODE_BLK_FILL); + + /* Set the pixel mask (enable writes to all pixels)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GPXR_P, 0xffffffff); + + color = ((val & 0xff00) << 24) || ((val & 0xff00) << 16) || + ((val & 0xff00) << 8) || ((val & 0xff00) << 0); + + /* Set the color for the block-fill... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GBCR0, color); + WRITE_GFB_REGISTER(adp, TGA_REG_GBCR1, color); + + /* + Just traverse the buffer, one 2K-pixel span at a time, setting + each pixel to the bolck-color... + */ + for(off = (x * y); off < ((x + cx) * (y + cy)); off += (2 KB)) + WRITE_GFB_BUFFER(adp, off >> 2L, 0x000007ff); + + /* Restore the pixel mode... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GPXR_P, gpxr); + + /* Restore the pixel mask... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GMOR, gmor); + + /* Restore the block-color... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GBCR0, gbcr0); + WRITE_GFB_REGISTER(adp, TGA_REG_GBCR1, gbcr1); + + return(0); +} + +static int +tga_bitblt(video_adapter_t *adp, ...) { + va_list args; + int i, count; + gfb_reg_t gmor; + gfb_reg_t gopr; + vm_offset_t src, dst; + + va_start(args, adp); + + /* Save the pixel mode... */ + gmor = READ_GFB_REGISTER(adp, TGA_REG_GMOR); + + /* Save the raster op... */ + gopr = READ_GFB_REGISTER(adp, TGA_REG_GOPR); + + /* Set the pixel mode (copy)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GMOR, + (gmor & ~GMOR_MODE_MASK) | GMOR_MODE_COPY); + + /* Set the raster op (src)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GOPR, (gopr & 0xfffffff0) | 0x3); + + src = (va_arg(args, vm_offset_t) + adp->va_window_orig) & + 0x0000000000fffff8; + dst = (va_arg(args, vm_offset_t) + adp->va_window_orig) & + 0x0000000000fffff8; + count = va_arg(args, int); + for(i = 0; i < count; i+= 64, src += 64, dst += 64) { + WRITE_GFB_REGISTER(adp, TGA_REG_GCSR, src); + WRITE_GFB_REGISTER(adp, TGA_REG_GCDR, dst); + } + + /* Restore the raster op... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GOPR, gopr); + + /* Restore the pixel mode... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GMOR, gmor); + + va_end(args); + return(0); +} + +static int +#if 0 +tga_clear(video_adapter_t *adp, int n) +else +tga_clear(video_adapter_t *adp) +#endif +{ + int off; + gfb_reg_t gpxr; + gfb_reg_t gmor; + gfb_reg_t gopr; + +#if 0 + if(n == 0) return(0); +#endif + + /* Save the pixel mode... */ + gmor = READ_GFB_REGISTER(adp, TGA_REG_GMOR); + + /* Save the pixel mask... */ + gpxr = READ_GFB_REGISTER(adp, TGA_REG_GPXR_P); + + /* Save the raster op... */ + gopr = READ_GFB_REGISTER(adp, TGA_REG_GOPR); + + /* Set the pixel mode (opaque-fill)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GMOR, + (gmor & ~GMOR_MODE_MASK) | GMOR_MODE_OPQ_FILL); + + /* Set the pixel mask (enable writes to all pixels)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GPXR_P, 0xffffffff); + + /* Set the raster op (clear)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GOPR, (gopr & 0xfffffff0) | 0x00); + + /* + Just traverse the buffer, one 2K-pixel span at a time, clearing + each pixel... + */ +#if 0 + for(off = 0; off < (n * adp->va_line_width); off += (2 KB)) +#endif + for(off = 0; off < adp->va_window_size; off += (2 KB)) + WRITE_GFB_BUFFER(adp, off >> 2L, 0x000007ff); + + /* Restore the pixel mask... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GPXR_P, gpxr); + + /* Restore the raster op... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GOPR, gopr); + + /* Restore the pixel mode... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GMOR, gmor); + + return(0); +} + +int +tga_putc(video_adapter_t *adp, vm_offset_t off, u_int8_t c, u_int8_t a) +{ + int i; + gfb_reg_t gpxr; + gfb_reg_t gmor; + gfb_reg_t gopr; + gfb_reg_t gbgr; + gfb_reg_t gfgr; + gfb_reg_t mask; + int row, col; + u_int8_t *pixel; + vm_offset_t poff; + struct gfb_softc *sc; + int pixel_size; + + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + pixel_size = adp->va_info.vi_depth / 8; + + /* Save the pixel mode... */ + gmor = READ_GFB_REGISTER(adp, TGA_REG_GMOR); + + /* Save the pixel mask... */ + gpxr = READ_GFB_REGISTER(adp, TGA_REG_GPXR_P); + + /* Save the raster op... */ + gopr = READ_GFB_REGISTER(adp, TGA_REG_GOPR); + + /* Save the background color... */ + gbgr = READ_GFB_REGISTER(adp, TGA_REG_GBGR); + + /* Save the foreground color... */ + gfgr = READ_GFB_REGISTER(adp, TGA_REG_GFGR); + + /* Set the pixel mode (opaque-stipple)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GMOR, + (gmor & ~GMOR_MODE_MASK) | GMOR_MODE_OPQ_STPL); + + /* Set the pixel mask (enable writes to the first cwidth pixels)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GPXR_P, + (1 << adp->va_info.vi_cwidth) - 1); + + /* Set the raster op (src)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GOPR, (gopr & 0xfffffff0) | 0x3); + + /* Set the foreground color mask from the attribute byte... */ + mask = (a & 0x80) ? a : (a & 0x0f); + + /* Propagate the 8-bit mask across the full 32 bits... */ + mask |= (mask << 24) | (mask << 16) | (mask << 8); + + /* Set the foreground color... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GFGR, mask); + + /* Set the background color mask from the attribute byte... */ + mask = (a >> 4) & 0x07; + + /* Propagate the 8-bit mask across the full 32 bits... */ + mask |= (mask << 24) | (mask << 16) | (mask << 8); + + /* Set the background color... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GBGR, mask); + + /* Get the start of the array of pixels rows for this character... */ + pixel = sc->gfbc->font + (c * adp->va_info.vi_cheight); + + /* Calculate the new cursor position... */ + row = off / adp->va_info.vi_width; + col = off % adp->va_info.vi_width; + + /* Iterate over all the pixel rows for this character... */ + for(i = 0; i < adp->va_info.vi_cheight; i++) { + + /* Get the address of the character's pixel-row... */ + poff = ((col * adp->va_info.vi_cwidth * pixel_size) + + (((row * adp->va_info.vi_cheight) + i) * + adp->va_line_width)) / sizeof(gfb_reg_t); + + /* Now display the current pixel row... */ + WRITE_GFB_BUFFER(adp, poff, pixel[i]); + } + + /* Restore the foreground color... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GFGR, gfgr); + + /* Restore the background color... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GBGR, gbgr); + + /* Restore the pixel mode... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GPXR_P, gpxr); + + /* Restore the pixel mask... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GMOR, gmor); + + /* Restore the raster op... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GOPR, gopr); + + return(0); +} + +int +tga_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len) +{ + int i, j, k; + gfb_reg_t gpxr; + gfb_reg_t gmor; + gfb_reg_t gopr; + gfb_reg_t row, col; + u_int8_t *pixel; + u_int8_t c; + u_int8_t a; + gfb_reg_t p; + vm_offset_t poff; + struct gfb_softc *sc; + int pixel_size; + + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + pixel_size = adp->va_info.vi_depth / 8; + + /* If the string in empty, just return now... */ + if(len == 0) return(0); + + for(i = 0; i < len; i++) + tga_putc(adp, off + i, s[i] & 0x00ff, (s[i] & 0xff00) >> 8); + return(0); + + /* Save the pixel mode... */ + gmor = READ_GFB_REGISTER(adp, TGA_REG_GMOR); + + /* Save the pixel mask... */ + gpxr = READ_GFB_REGISTER(adp, TGA_REG_GPXR_P); + + /* Save the raster op... */ + gopr = READ_GFB_REGISTER(adp, TGA_REG_GOPR); + + /* Set the pixel mode (simple)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GMOR, (gmor & 0xffffffc0) | 0x00); + + /* Set the pixel mask (enable writes to all 32 pixels)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GPXR_P, (gpxr & 0xfffffff0) | 0xf); + + /* Set the raster op (src)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GOPR, (gopr & 0xfffffff0) | 0x03); + + /* + First, do as many characters-rows at a time as possible (as exist)... + */ + for(i = 0; (len - i) > adp->va_info.vi_width; + i += adp->va_info.vi_width) { + + /* + Iterate over all the pixels for each character in the + character-row, doing a scan-line at-a-time, rather than + a character at-a-time (like tga_putc())... + */ + for(j = 0; j < adp->va_info.vi_cheight; j++) { + p = 0; + for(k = 0; k < adp->va_info.vi_width; k++) { + + /* + Get this character... + */ + c = s[i + k] & 0x00ff; + + /* + Get the attribute for this character... + */ + a = (s[i + k] & 0xff00) >> 8; + + /* + Get the start of the array of pixels rows for + this character... + */ + pixel = sc->gfbc->font + + (c * adp->va_info.vi_cheight); + + /* Shift the other pre-existing pixel rows... */ + p <<= 8; + + /* + Get the first pixel row for + this character... + */ + p |= pixel[j]; + + if (((k + 1) % sizeof(gfb_reg_t)) == 0) { + + /* + Calculate the new cursor + position... + */ + row = (off + i + (k - + (sizeof(gfb_reg_t) - 1))) / + adp->va_info.vi_width; + col = (off + i + (k - + (sizeof(gfb_reg_t) - 1))) % + adp->va_info.vi_width; + + /* + Get the address of the current + character's pixel-row... + */ + poff = ((col * adp->va_info.vi_cwidth * + pixel_size) + (((row * + adp->va_info.vi_cheight) + j) * + adp->va_line_width)) / + sizeof(gfb_reg_t); + + /* + Now display the current + pixel row... + */ + (*vidsw[adp->va_index]->putp)(adp, poff, + p, a, sizeof(gfb_reg_t), + adp->va_info.vi_depth, 1, 0); + + /* Reset (clear) p... */ + p = 0; + } + } + } + } + + /* + Next, do as many character-sets at a time as possible (as exist)... + */ + for(; (len - i) > sizeof(gfb_reg_t); i += sizeof(gfb_reg_t)) { + + /* + Iterate over all the pixels for each character in the + character-row, doing a scan-line at-a-time, rather than + a character at-a-time (like tga_putc())... + */ + for(j = 0; j < adp->va_info.vi_cheight; j++) { + p = 0; + for(k = 0; k < sizeof(gfb_reg_t); k++) { + + /* + Get this character... + */ + c = s[i + k] & 0x00ff; + + /* + Get the attribute for this character... + */ + a = (s[i + k] & 0xff00) >> 8; + + /* + Get the start of the array of pixels rows for + this character... + */ + pixel = sc->gfbc->font + + (c * adp->va_info.vi_cheight); + + /* Shift the other pre-existing pixel rows... */ + p <<= 8; + + /* + Get the first pixel row for + this character... + */ + p |= pixel[j]; + + if (((k + 1) % sizeof(gfb_reg_t)) == 0) { + + /* + Calculate the new cursor + position... + */ + row = (off + i) / adp->va_info.vi_width; + col = (off + i) % adp->va_info.vi_width; + + /* + Get the address of the current + character's pixel-row... + */ + poff = ((col * adp->va_info.vi_cwidth * + pixel_size) + (((row * + adp->va_info.vi_cheight) + j) * + adp->va_line_width)) / + sizeof(gfb_reg_t); + + /* + Now display the current + pixel row... + */ + (*vidsw[adp->va_index]->putp)(adp, poff, + p, a, sizeof(gfb_reg_t), + adp->va_info.vi_depth, 1, 0); + + /* Reset (clear) p... */ + p = 0; + } + } + } + } + + /* Restore the pixel mode... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GPXR_P, gpxr); + + /* Restore the pixel mask... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GMOR, gmor); + + /* Restore the raster op... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GOPR, gopr); + + /* Finally, do the remaining characters a character at-a-time... */ + for(; i < len; i++) { + /* + Get this character... + */ + c = s[i] & 0x00ff; + + /* + Get the attribute for this character... + */ + a = (s[i] & 0xff00) >> 8; + + /* + Display this character... + */ + tga_putc(adp, off + i, c, a); + } + return(0); +} + +int +tga_putm(video_adapter_t *adp, int x, int y, u_int8_t *pixel_image, + gfb_reg_t pixel_mask, int size) +{ + gfb_reg_t gpxr; + gfb_reg_t gmor; + gfb_reg_t gopr; + int i, pixel_size; + vm_offset_t poff; + + pixel_size = adp->va_info.vi_depth / 8; + + /* Save the pixel mode... */ + gmor = READ_GFB_REGISTER(adp, TGA_REG_GMOR); + + /* Save the pixel mask... */ + gpxr = READ_GFB_REGISTER(adp, TGA_REG_GPXR_P); + + /* Save the raster op... */ + gopr = READ_GFB_REGISTER(adp, TGA_REG_GOPR); + + /* Set the pixel mode (simple)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GMOR, + (gmor & ~GMOR_MODE_MASK) | GMOR_MODE_SIMPLE); + + /* Set the pixel mask (enable writes to the first 8 pixels)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GPXR_P, (gpxr & 0xfffffff0) | 0xf); + + /* Set the raster op (src)... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GOPR, (gopr & 0xfffffff0) | 0x3); + + /* Iterate over all the pixel rows for the mouse pointer... */ + for(i = 0; i < size; i++) { + + /* Get the address of the mouse pointer's pixel-row... */ + poff = ((x * pixel_size) + ((y + i) * adp->va_line_width)) / + sizeof(gfb_reg_t); + + /* Now display the current pixel-row... */ + (*vidsw[adp->va_index]->putp)(adp, poff, pixel_image[i], + pixel_mask, sizeof(u_int8_t), adp->va_info.vi_depth, 1, 0); + } + + /* Restore the pixel mode... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GPXR_P, gpxr); + + /* Restore the pixel mask... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GMOR, gmor); + + /* Restore the raster op... */ + WRITE_GFB_REGISTER(adp, TGA_REG_GOPR, gopr); + + return(0); +} + +static int +tga_error(void) +{ + return(0); +} + +/***************************************************************************** + * + * TGA-specific functions + * + ****************************************************************************/ + +static int +tga_builtin_save_palette(video_adapter_t *adp, video_color_palette_t *palette) +{ + int i; + int error; + struct gfb_softc *sc; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* + * We store 8 bit values in the palette buffer, while the standard + * VGA has 6 bit DAC . + */ + outb(PALRADR, 0x00); + for(i = 0; i < palette->count; ++i) { + palette->red[i] = inb(PALDATA) << 2; + palette->green[i] = inb(PALDATA) << 2; + palette->blue[i] = inb(PALDATA) << 2; + } + return(error); +} + +static int +tga_builtin_load_palette(video_adapter_t *adp, video_color_palette_t *palette) +{ + int i; + int error; + struct gfb_softc *sc; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* + * We store 8 bit values in the palette buffer, while the standard + * VGA has 6 bit DAC . + */ + outb(PIXMASK, 0xff); + outb(PALWADR, 0x00); + for(i = 0; i < palette->count; ++i) { + outb(PALDATA, palette->red[i] >> 2); + outb(PALDATA, palette->green[i] >> 2); + outb(PALDATA, palette->blue[i] >> 2); + } + return(error); +} + +static int +tga2_builtin_save_palette(video_adapter_t *adp, video_color_palette_t *palette) +{ + int i; + int error; + struct gfb_softc *sc; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_LOW, + BT463_IREG_CPALETTE_RAM & 0xff); + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_HIGH, + (BT463_IREG_CPALETTE_RAM >> 8) & 0xff); + + /* spit out the colormap data */ + for(i = 0; i < palette->count; i++) { + sc->gfbc->ramdac_wr(sc, BT463_REG_CMAP_DATA, + palette->red[i]); + sc->gfbc->ramdac_wr(sc, BT463_REG_CMAP_DATA, + palette->green[i]); + sc->gfbc->ramdac_wr(sc, BT463_REG_CMAP_DATA, + palette->blue[i]); + } + return(error); +} + +static int +tga2_builtin_load_palette(video_adapter_t *adp, video_color_palette_t *palette) +{ + int i; + int error; + struct gfb_softc *sc; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_LOW, + BT463_IREG_CPALETTE_RAM & 0xff); + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_HIGH, + (BT463_IREG_CPALETTE_RAM >> 8) & 0xff); + + /* spit out the colormap data */ + for(i = 0; i < palette->count; i++) { + sc->gfbc->ramdac_wr(sc, BT463_REG_CMAP_DATA, + palette->red[i]); + sc->gfbc->ramdac_wr(sc, BT463_REG_CMAP_DATA, + palette->green[i]); + sc->gfbc->ramdac_wr(sc, BT463_REG_CMAP_DATA, + palette->blue[i]); + } + return(error); +} + +static int +tga2_builtin_save_cursor_palette(video_adapter_t *adp, struct fbcmap *palette) +{ + int i; + int error; + struct gfb_softc *sc; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_LOW, + BT463_IREG_CURSOR_COLOR_0 & 0xff); + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_HIGH, + (BT463_IREG_CURSOR_COLOR_0 >> 8) & 0xff); + + /* spit out the cursor data */ + for(i = 0; i < palette->count; i++) { + BTWNREG(sc, palette->red[i]); + BTWNREG(sc, palette->green[i]); + BTWNREG(sc, palette->blue[i]); + } + return(error); +} + +static int +tga2_builtin_load_cursor_palette(video_adapter_t *adp, struct fbcmap *palette) +{ + int i; + int error; + struct gfb_softc *sc; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_LOW, + BT463_IREG_CURSOR_COLOR_0 & 0xff); + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_HIGH, + (BT463_IREG_CURSOR_COLOR_0 >> 8) & 0xff); + + /* spit out the cursor data */ + for(i = 0; i < palette->count; i++) { + BTWNREG(sc, palette->red[i]); + BTWNREG(sc, palette->green[i]); + BTWNREG(sc, palette->blue[i]); + } + return(error); +} + +static int +tga_builtin_read_hw_cursor(video_adapter_t *adp, int col, int row) +{ + gfb_reg_t cxyr; + int error; + + /* Assume the best... */ + error = 0; + + cxyr = READ_GFB_REGISTER(adp, TGA_REG_CXYR) | 0x00ffffff; + *col = (cxyr & 0x00000fff) / adp->va_info.vi_cwidth; + *row = ((cxyr & 0x00fff000) >> 12) / adp->va_info.vi_cheight; + return(error); +} + +static int +tga_builtin_set_hw_cursor(video_adapter_t *adp, int col, int row) +{ + int error; + gfb_reg_t cxyr; + gfb_reg_t vvvr; + + /* Assume the best... */ + error = 0; + + vvvr = READ_GFB_REGISTER(adp, TGA_REG_VVVR); + + /* + Make sure the parameters are in range for the screen + size... + */ + if((row > adp->va_info.vi_height) || + (col > adp->va_info.vi_width)) + error = EINVAL; + else if(((row * adp->va_info.vi_cheight) > 0x0fff) || + ((col * adp->va_info.vi_cwidth) > 0x0fff)) + error = EINVAL; + /* + If either of the parameters is less than 0, + then hide the cursor... + */ + else if((row < 0) || (col < 0)) { + if((vvvr & 0x00000004) != 0) { + vvvr &= 0xfffffffb; + WRITE_GFB_REGISTER(adp, TGA_REG_VVVR, vvvr); + } + } + + /* Otherwise, just move the cursor as requested... */ + else { + cxyr = READ_GFB_REGISTER(adp, TGA_REG_CXYR) & 0xff000000; + cxyr |= ((row * adp->va_info.vi_cheight) << 12); + cxyr |= (col * adp->va_info.vi_cwidth); + WRITE_GFB_REGISTER(adp, TGA_REG_CXYR, cxyr); + if((vvvr & 0x00000004) == 0) { + vvvr |= 0x00000004; + WRITE_GFB_REGISTER(adp, TGA_REG_VVVR, vvvr); + } + } + return(error); +} + +static int +tga_builtin_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, + int cellsize, int blink) +{ + int i, j; + vm_offset_t cba; + gfb_reg_t window_orig; + gfb_reg_t ccbr; + gfb_reg_t vvvr; + int error; + + /* Assume the best... */ + error = 0; + + vvvr = READ_GFB_REGISTER(adp, TGA_REG_VVVR); + + /* + Make sure the parameters are in range for the cursor + (it's a 64x64 cursor)... + */ + if(height > 64) + error = EINVAL; + + /* If height is less than or equal to 0, then hide the cursor... */ + else if(height <= 0) { + if((vvvr & 0x00000004) != 0) { + vvvr &= 0xfffffffb; + WRITE_GFB_REGISTER(adp, TGA_REG_VVVR, vvvr); + } + } + + /* Otherwise, just resize the cursor as requested... */ + else { + ccbr = READ_GFB_REGISTER(adp, TGA_REG_CCBR); + ccbr &= 0xffff03ff; + ccbr |= ((height - 1) << 10); + WRITE_GFB_REGISTER(adp, TGA_REG_CCBR, ccbr); + if((vvvr & 0x00000004) == 0) { + vvvr |= 0x00000004; + WRITE_GFB_REGISTER(adp, TGA_REG_VVVR, vvvr); + } + + /* Save the window origin... */ + window_orig = adp->va_window_orig; + + /* + Fill in the cursor image (64 rows of 64 pixels per cursor + row at 2 bits-per-pixel, so 64 rows of 16 bytes each)--we + set va_window_orig to the cursor base address temporarily + so that we can write to the cursor image... + */ + cba = (READ_GFB_REGISTER(adp, TGA_REG_CCBR) & 0xfffffc0f) >> 4; + adp->va_window_orig = cba; + for(i = 0; i < (64 - height); i++) { + WRITE_GFB_BUFFER(adp, cba++, 0x00000000); + WRITE_GFB_BUFFER(adp, cba++, 0x00000000); + } + for(; i < 64; i++) { + for(j = 0; j < (((64 - cellsize) / 8) / + sizeof(gfb_reg_t)); j++) + WRITE_GFB_BUFFER(adp, cba++, 0x00000000); + for(; j < ((64 / 8) / sizeof(gfb_reg_t)); j++) + WRITE_GFB_BUFFER(adp, cba++, 0xffffffff); + } + + /* Restore the window origin... */ + adp->va_window_orig = window_orig; + + } + return(error); +} + +static void +bt463_load_palette_intr(struct gfb_softc *sc) +{ + sc->gfbc->ramdac_save_palette(sc->adp, &sc->gfbc->palette); +} + +static void +bt463_load_cursor_palette_intr(struct gfb_softc *sc) +{ + sc->gfbc->ramdac_load_cursor_palette(sc->adp, &sc->gfbc->cursor_palette); +} + +static int +tga_schedule_intr(struct gfb_softc *sc, void (*f)(struct gfb_softc *)) +{ + /* Busy-wait for the previous interrupt to complete... */ + while((READ_GFB_REGISTER(sc->adp, TGA_REG_SISR) & 0x00000001) != 0); + + /* Arrange for f to be called at the next end-of-frame interrupt... */ + sc->gfbc->ramdac_intr = f; + + /* Enable the interrupt... */ + WRITE_GFB_REGISTER(sc->adp, TGA_REG_SISR, 0x00010000); + return(0); +} + +static u_int8_t +tga_bt485_rd(struct gfb_softc *sc, u_int btreg) +{ + gfb_reg_t rdval; + + if(btreg > BT485_REG_MAX) + panic("tga_ramdac_rd: reg %d out of range\n", btreg); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_EPSR, (btreg << 1) | 0x1); + GFB_REGISTER_WRITE_BARRIER(sc, TGA_REG_EPSR, 1); + rdval = READ_GFB_REGISTER(sc->adp, TGA_REG_EPDR); + return((rdval >> 16) & 0xff); +} + +static void +tga_bt485_wr(struct gfb_softc *sc, u_int btreg, u_int8_t val) +{ + if(btreg > BT485_REG_MAX) + panic("tga_ramdac_wr: reg %d out of range\n", btreg); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_EPDR, + (btreg << 9) | (0 << 8 ) | val); + GFB_REGISTER_WRITE_BARRIER(sc, TGA_REG_EPDR, 1); +} + +static u_int8_t +tga2_ibm561_rd(struct gfb_softc *sc, u_int btreg) +{ + bus_space_handle_t ramdac; + u_int8_t retval; + + if(btreg > BT485_REG_MAX) + panic("tga_ramdac_rd: reg %d out of range\n", btreg); + ramdac = sc->bhandle + TGA2_MEM_RAMDAC + (0xe << 12) + (btreg << 8); + retval = bus_space_read_4(sc->btag, ramdac, 0) & 0xff; + bus_space_barrier(sc->btag, ramdac, 0, 4, BUS_SPACE_BARRIER_READ); + return(retval); +} + +static void +tga2_ibm561_wr(struct gfb_softc *sc, u_int btreg, u_int8_t val) +{ + bus_space_handle_t ramdac; + + if(btreg > BT485_REG_MAX) + panic("tga_ramdac_wr: reg %d out of range\n", btreg); + ramdac = sc->bhandle + TGA2_MEM_RAMDAC + (0xe << 12) + (btreg << 8); + bus_space_write_4(sc->btag, ramdac, 0, val & 0xff); + bus_space_barrier(sc->btag, ramdac, 0, 4, BUS_SPACE_BARRIER_WRITE); +} + +static u_int8_t +tga_bt463_rd(struct gfb_softc *sc, u_int btreg) +{ + gfb_reg_t rdval; + + /* + * Strobe CE# (high->low->high) since status and data are latched on + * the falling and rising edges (repsectively) of this active-low + * signal. + */ + + GFB_REGISTER_WRITE_BARRIER(sc, TGA_REG_EPSR, 1); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_EPSR, (btreg << 2) | 2 | 1); + GFB_REGISTER_WRITE_BARRIER(sc, TGA_REG_EPSR, 1); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_EPSR, (btreg << 2) | 2 | 0); + GFB_REGISTER_READ_BARRIER(sc, TGA_REG_EPSR, 1); + rdval = READ_GFB_REGISTER(sc->adp, TGA_REG_EPDR); + GFB_REGISTER_WRITE_BARRIER(sc, TGA_REG_EPSR, 1); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_EPSR, (btreg << 2) | 2 | 1); + return((rdval >> 16) & 0xff); +} + +static void +tga_bt463_wr(struct gfb_softc *sc, u_int btreg, u_int8_t val) +{ + /* + * In spite of the 21030 documentation, to set the MPU bus bits for + * a write, you set them in the upper bits of EPDR, not EPSR. + */ + + /* + * Strobe CE# (high->low->high) since status and data are latched on + * the falling and rising edges of this active-low signal. + */ + + GFB_REGISTER_WRITE_BARRIER(sc, TGA_REG_EPDR, 1); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_EPDR, (btreg << 10) | 0x100 | val); + GFB_REGISTER_WRITE_BARRIER(sc, TGA_REG_EPDR, 1); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_EPDR, (btreg << 10) | 0x000 | val); + GFB_REGISTER_WRITE_BARRIER(sc, TGA_REG_EPDR, 1); + WRITE_GFB_REGISTER(sc->adp, TGA_REG_EPDR, (btreg << 10) | 0x100 | val); +} + +static void +tga2_ics9110_wr(struct gfb_softc *sc, int dotclock) +{ + bus_space_handle_t clock; + gfb_reg_t valU; + int N, M, R, V, X; + int i; + + switch(dotclock) { + case 130808000: + N = 0x40; M = 0x7; V = 0x0; X = 0x1; R = 0x1; break; + case 119840000: + N = 0x2d; M = 0x2b; V = 0x1; X = 0x1; R = 0x1; break; + case 108180000: + N = 0x11; M = 0x9; V = 0x1; X = 0x1; R = 0x2; break; + case 103994000: + N = 0x6d; M = 0xf; V = 0x0; X = 0x1; R = 0x1; break; + case 175000000: + N = 0x5F; M = 0x3E; V = 0x1; X = 0x1; R = 0x1; break; + case 75000000: + N = 0x6e; M = 0x15; V = 0x0; X = 0x1; R = 0x1; break; + case 74000000: + N = 0x2a; M = 0x41; V = 0x1; X = 0x1; R = 0x1; break; + case 69000000: + N = 0x35; M = 0xb; V = 0x0; X = 0x1; R = 0x1; break; + case 65000000: + N = 0x6d; M = 0x0c; V = 0x0; X = 0x1; R = 0x2; break; + case 50000000: + N = 0x37; M = 0x3f; V = 0x1; X = 0x1; R = 0x2; break; + case 40000000: + N = 0x5f; M = 0x11; V = 0x0; X = 0x1; R = 0x2; break; + case 31500000: + N = 0x16; M = 0x05; V = 0x0; X = 0x1; R = 0x2; break; + case 25175000: + N = 0x66; M = 0x1d; V = 0x0; X = 0x1; R = 0x2; break; + case 135000000: + N = 0x42; M = 0x07; V = 0x0; X = 0x1; R = 0x1; break; + case 110000000: + N = 0x60; M = 0x32; V = 0x1; X = 0x1; R = 0x2; break; + case 202500000: + N = 0x60; M = 0x32; V = 0x1; X = 0x1; R = 0x2; break; + default: + panic("unrecognized clock rate %d\n", dotclock); + } + + /* XXX -- hard coded, bad */ + valU = N | ( M << 7 ) | (V << 14); + valU |= (X << 15) | (R << 17); + valU |= 0x17 << 19; + clock = sc->bhandle + TGA2_MEM_EXTDEV + TGA2_MEM_CLOCK + (0xe << 12); + for(i = 24; i > 0; i--) { + gfb_reg_t writeval; + + writeval = valU & 0x1; + if (i == 1) + writeval |= 0x2; + valU >>= 1; + bus_space_write_4(sc->btag, clock, 0, writeval); + bus_space_barrier(sc->btag, clock, 0, 4, + BUS_SPACE_BARRIER_WRITE); + } + clock = sc->bhandle + TGA2_MEM_EXTDEV + TGA2_MEM_CLOCK + (0xe << 12) + + (0x1 << 11) + (0x1 << 11); + bus_space_write_4(sc->btag, clock, 0, 0x0); + bus_space_barrier(sc->btag, clock, 0, 0, BUS_SPACE_BARRIER_WRITE); +} + +/***************************************************************************** + * + * BrookTree RAMDAC-specific functions + * + ****************************************************************************/ + +static void +bt463_init(struct gfb_softc *sc) +{ + int i; + + return; + + /* + * Init the BT463 for normal operation. + */ + + /* + * Setup: + * reg 0: 4:1 multiplexing, 25/75 blink. + * reg 1: Overlay mapping: mapped to common palette, + * 14 window type entries, 24-plane configuration mode, + * 4 overlay planes, underlays disabled, no cursor. + * reg 2: sync-on-green enabled, pedestal enabled. + */ + + BTWREG(sc, BT463_IREG_COMMAND_0, 0x40); + BTWREG(sc, BT463_IREG_COMMAND_1, 0x48); + BTWREG(sc, BT463_IREG_COMMAND_2, 0xC0); + + /* + * Initialize the read mask. + */ + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_LOW, + BT463_IREG_READ_MASK_P0_P7 & 0xff); + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_HIGH, + (BT463_IREG_READ_MASK_P0_P7 >> 8) & 0xff); + for(i = 0; i < 4; i++) + BTWNREG(sc, 0xff); + + /* + * Initialize the blink mask. + */ + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_LOW, + BT463_IREG_READ_MASK_P0_P7 & 0xff); + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_HIGH, + (BT463_IREG_READ_MASK_P0_P7 >> 8) & 0xff); + for(i = 0; i < 4; i++) + BTWNREG(sc, 0); + + /* + * Clear test register + */ + BTWREG(sc, BT463_IREG_TEST, 0); + + /* + * Initalize the RAMDAC info struct to hold all of our + * data, and fill it in. + */ + + /* Initialize the window type table: + * + * Entry 0: 24-plane truecolor, overlays enabled, bypassed. + * + * Lookup table bypass: yes ( 1 << 23 & 0x800000) 800000 + * Colormap address: 0x000 (0x000 << 17 & 0x7e0000) 0 + * Overlay mask: 0xf ( 0xf << 13 & 0x01e000) 1e000 + * Overlay location: P<27:24> ( 0 << 12 & 0x001000) 0 + * Display mode: Truecolor ( 0 << 9 & 0x000e00) 000 + * Number of planes: 8 ( 8 << 5 & 0x0001e0) 100 + * Plane shift: 0 ( 0 << 0 & 0x00001f) 0 + * -------- + * 0x81e100 + */ +#if 0 + data->window_type[0] = 0x81e100; +#endif + + /* Entry 1: 8-plane pseudocolor in the bottom 8 bits, + * overlays enabled, colormap starting at 0. + * + * Lookup table bypass: no ( 0 << 23 & 0x800000) 0 + * Colormap address: 0x000 (0x000 << 17 & 0x7e0000) 0 + * Overlay mask: 0xf ( 0xf << 13 & 0x01e000) 0x1e000 + * Overlay location: P<27:24> ( 0 << 12 & 0x001000) 0 + * Display mode: Pseudocolor ( 1 << 9 & 0x000e00) 0x200 + * Number of planes: 8 ( 8 << 5 & 0x0001e0) 0x100 + * Plane shift: 16 ( 0x10 << 0 & 0x00001f) 10 + * -------- + * 0x01e310 + */ +#if 0 + data->window_type[1] = 0x01e310; +#endif + /* The colormap interface to the world only supports one colormap, + * so having an entry for the 'alternate' colormap in the bt463 + * probably isn't useful. + */ + + /* Fill the remaining table entries with clones of entry 0 until we + * figure out a better use for them. + */ +#if 0 + for(i = 2; i < BT463_NWTYPE_ENTRIES; i++) { + data->window_type[i] = 0x81e100; + } +#endif + + tga_schedule_intr(sc, bt463_update_window_type); + tga_schedule_intr(sc, bt463_load_cursor_palette_intr); + tga_schedule_intr(sc, bt463_load_palette_intr); +} + +static void +bt463_update_window_type(struct gfb_softc *sc) +{ + int i; + + /* The Bt463 won't accept window type data except during a blanking + * interval, so we do this early in the interrupt. + * Blanking the screen might also be a good idea, but it can cause + * unpleasant flashing and is hard to do from this side of the + * ramdac interface. + */ + /* spit out the window type data */ + for(i = 0; i < BT463_NWTYPE_ENTRIES; i++) { +#if 0 + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_LOW, + (BT463_IREG_WINDOW_TYPE_TABLE + i) & 0xff); + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_HIGH, + ((BT463_IREG_WINDOW_TYPE_TABLE + i) >> 8) & 0xff); + BTWNREG(sc, (data->window_type[i]) & 0xff); + BTWNREG(sc, (data->window_type[i] >> 8) & 0xff); + BTWNREG(sc, (data->window_type[i] >> 16) & 0xff); +#endif + } +} + +static int +bt463_save_palette(video_adapter_t *adp, video_color_palette_t *palette) +{ + struct gfb_softc *sc; + int error, i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_LOW, + BT463_IREG_CPALETTE_RAM & 0xff); + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_HIGH, + (BT463_IREG_CPALETTE_RAM >> 8) & 0xff); + + /* get the colormap data */ + for(i = 0; i < palette->count; i++) { + palette->red[i] = sc->gfbc->ramdac_rd(sc, BT463_REG_CMAP_DATA); + palette->green[i] = sc->gfbc->ramdac_rd(sc, + BT463_REG_CMAP_DATA); + palette->blue[i] = sc->gfbc->ramdac_rd(sc, BT463_REG_CMAP_DATA); + } + return(error); +} + +static int +bt463_load_palette(video_adapter_t *adp, video_color_palette_t *palette) +{ + struct gfb_softc *sc; + int error, i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_LOW, + BT463_IREG_CPALETTE_RAM & 0xff); + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_HIGH, + (BT463_IREG_CPALETTE_RAM >> 8) & 0xff); + + /* spit out the colormap data */ + for(i = 0; i < palette->count; i++) { + sc->gfbc->ramdac_wr(sc, BT463_REG_CMAP_DATA, palette->red[i]); + sc->gfbc->ramdac_wr(sc, BT463_REG_CMAP_DATA, palette->green[i]); + sc->gfbc->ramdac_wr(sc, BT463_REG_CMAP_DATA, palette->blue[i]); + } + return(error); +} + +static int +bt463_save_cursor_palette(video_adapter_t *adp, struct fbcmap *palette) +{ + struct gfb_softc *sc; + int error, i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_LOW, + BT463_IREG_CURSOR_COLOR_0 & 0xff); + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_HIGH, + (BT463_IREG_CURSOR_COLOR_0 >> 8) & 0xff); + + /* spit out the cursor data */ + for(i = 0; i < palette->count; i++) { + palette->red[i] = BTRNREG(sc); + palette->green[i] = BTRNREG(sc); + palette->blue[i] = BTRNREG(sc); + } + return(error); +} + +static int +bt463_load_cursor_palette(video_adapter_t *adp, struct bfcmap *palette) +{ + struct gfb_softc *sc; + int error, i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_LOW, + BT463_IREG_CURSOR_COLOR_0 & 0xff); + sc->gfbc->ramdac_wr(sc, BT463_REG_ADDR_HIGH, + (BT463_IREG_CURSOR_COLOR_0 >> 8) & 0xff); + + /* spit out the cursor data */ + for(i = 0; i < palette->count; i++) { + BTWNREG(sc, palette->red[i]); + BTWNREG(sc, palette->green[i]); + BTWNREG(sc, palette->blue[i]); + } + return(error); +} + +static void +bt485_init(struct gfb_softc *sc) +{ + int i, j, num_cmap_entries; + u_int8_t regval; + + regval = sc->gfbc->ramdac_rd(sc, BT485_REG_COMMAND_0); + + /* + * Set the RAMDAC to 8 bit resolution, rather than 6 bit + * resolution. + */ + regval |= 0x02; + + /* + * Set the RAMDAC to sync-on-green. + */ + regval |= 0x08; + sc->gfbc->ramdac_wr(sc, BT485_REG_COMMAND_0, regval); + +#if 0 + /* Set the RAMDAC to 8BPP (no interesting options). */ + sc->gfbc->ramdac_wr(sc, BT485_REG_COMMAND_1, 0x40); + + /* Disable the cursor (for now) */ + regval = sc->gfbc->ramdac_rd(sc, BT485_REG_COMMAND_2); + regval &= ~0x03; + regval |= 0x24; + sc->gfbc->ramdac_wr(sc, BT485_REG_COMMAND_2, regval); + + /* Use a 64x64x2 cursor */ + sc->gfbc->ramdac_wr(sc, BT485_REG_PCRAM_WRADDR, BT485_IREG_COMMAND_3); + regval = sc->gfbc->ramdac_rd(sc, BT485_REG_EXTENDED); + regval |= 0x04; + regval |= 0x08; + sc->gfbc->ramdac_wr(sc, BT485_REG_PCRAM_WRADDR, BT485_IREG_COMMAND_3); + sc->gfbc->ramdac_wr(sc, BT485_REG_EXTENDED, regval); + + /* Set the Pixel Mask to something useful */ + sc->gfbc->ramdac_wr(sc, BT485_REG_PIXMASK, 0xff); +#endif + + /* Generate the cursor color map (Light-Grey)... */ + for(i = 0; i < sc->gfbc->cursor_palette.count; i++) { + sc->gfbc->cursor_palette.red[i] = default_cmap[7].red; + sc->gfbc->cursor_palette.green[i] = default_cmap[7].green; + sc->gfbc->cursor_palette.blue[i] = default_cmap[7].blue; + } + +#if 0 + /* Enable cursor... */ + regval = sc->gfbc->ramdac_rd(sc, BT485_REG_COMMAND_2); + if(!(regval & 0x01)) { + regval |= 0x01; + sc->gfbc->ramdac_wr(sc, BT485_REG_COMMAND_2, regval); + } + else if(regval & 0x03) { + regval &= ~0x03; + sc->gfbc->ramdac_wr(sc, BT485_REG_COMMAND_2, regval); + } +#endif + + /* Generate the screen color map... */ + num_cmap_entries = sizeof(default_cmap) / sizeof(struct cmap); + for(i = 0; i < sc->gfbc->palette.count / num_cmap_entries; i++) + for(j = 0; j < num_cmap_entries; j++) { + sc->gfbc->palette.red[(num_cmap_entries * i) + j] = + default_cmap[j].red; + sc->gfbc->palette.green[(num_cmap_entries * i) + j] = + default_cmap[j].green; + sc->gfbc->palette.blue[(num_cmap_entries * i) + j] = + default_cmap[j].blue; + } +} + +static int +bt485_save_palette(video_adapter_t *adp, video_color_palette_t *palette) +{ + struct gfb_softc *sc; + int error, i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* addr[9:0] assumed to be 0 */ + /* set addr[7:0] to 0 */ + sc->gfbc->ramdac_wr(sc, BT485_REG_PCRAM_WRADDR, 0x00); + + /* spit out the color data */ + for(i = 0; i < palette->count; i++) { + palette->red[i] = sc->gfbc->ramdac_rd(sc, BT485_REG_PALETTE); + palette->green[i] = sc->gfbc->ramdac_rd(sc, BT485_REG_PALETTE); + palette->blue[i] = sc->gfbc->ramdac_rd(sc, BT485_REG_PALETTE); + } + return(error); +} + +static int +bt485_load_palette(video_adapter_t *adp, video_color_palette_t *palette) +{ + struct gfb_softc *sc; + int error, i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* addr[9:0] assumed to be 0 */ + /* set addr[7:0] to 0 */ + sc->gfbc->ramdac_wr(sc, BT485_REG_PCRAM_WRADDR, 0x00); + + /* spit out the color data */ + for(i = 0; i < palette->count; i++) { + sc->gfbc->ramdac_wr(sc, BT485_REG_PALETTE, palette->red[i]); + sc->gfbc->ramdac_wr(sc, BT485_REG_PALETTE, palette->green[i]); + sc->gfbc->ramdac_wr(sc, BT485_REG_PALETTE, palette->blue[i]); + } + return(error); +} + +static int +bt485_save_cursor_palette(video_adapter_t *adp, struct fbcmap *palette) +{ + struct gfb_softc *sc; + int error, i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* addr[9:0] assumed to be 0 */ + /* set addr[7:0] to 1 */ + sc->gfbc->ramdac_wr(sc, BT485_REG_COC_WRADDR, 0x01); + + /* spit out the cursor color data */ + for(i = 0; i < palette->count; i++) { + palette->red[i] = sc->gfbc->ramdac_rd(sc, BT485_REG_COCDATA); + palette->green[i] = sc->gfbc->ramdac_rd(sc, BT485_REG_COCDATA); + palette->blue[i] = sc->gfbc->ramdac_rd(sc, BT485_REG_COCDATA); + } + return(error); +} + +static int +bt485_load_cursor_palette(video_adapter_t *adp, struct fbcmap *palette) +{ + struct gfb_softc *sc; + int error, i; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* addr[9:0] assumed to be 0 */ + /* set addr[7:0] to 1 */ + sc->gfbc->ramdac_wr(sc, BT485_REG_COC_WRADDR, 0x01); + + /* spit out the cursor color data */ + for(i = 0; i < palette->count; i++) { + sc->gfbc->ramdac_wr(sc, BT485_REG_COCDATA, palette->red[i]); + sc->gfbc->ramdac_wr(sc, BT485_REG_COCDATA, palette->green[i]); + sc->gfbc->ramdac_wr(sc, BT485_REG_COCDATA, palette->blue[i]); + } + return(error); +} + +static int +bt485_read_hw_cursor(video_adapter_t *adp, int *col, int *row) +{ + struct gfb_softc *sc; + int error, s; + + error = 0; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + s = spltty(); + *col = (sc->gfbc->ramdac_rd(sc, BT485_REG_CURSOR_X_HIGH) & 0x0f) << 8; + *col |= sc->gfbc->ramdac_rd(sc, BT485_REG_CURSOR_X_LOW) & 0xff; + *col /= adp->va_info.vi_cwidth; + *col -= 8; + *row = (sc->gfbc->ramdac_rd(sc, BT485_REG_CURSOR_Y_HIGH) & 0x0f) << 8; + *row |= sc->gfbc->ramdac_rd(sc, BT485_REG_CURSOR_Y_LOW) & 0xff; + *row /= adp->va_info.vi_cheight; + *row -= 4; + splx(s); + return(error); +} + +static int +bt485_set_hw_cursor(video_adapter_t *adp, int col, int row) +{ + struct gfb_softc *sc; + int error, s; + + error = 0; + + /* Make sure the parameters are in range for the screen + size... */ + if((row > adp->va_info.vi_height) || (col > adp->va_info.vi_width)) + error = EINVAL; + else if(((row * adp->va_info.vi_cheight) > 0x0fff) || + ((col * adp->va_info.vi_cwidth) > 0x0fff)) + error = EINVAL; + else if((row < 0) || (col < 0)) { + /* If either of the parameters is less than 0, then hide the + cursor... */ + col = -8; + row = -4; + } else { + /* Otherwise, just move the cursor as requested... */ + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + s = spltty(); + sc->gfbc->ramdac_wr(sc, BT485_REG_CURSOR_X_LOW, + ((col + 8) * adp->va_info.vi_cwidth) & 0xff); + sc->gfbc->ramdac_wr(sc, BT485_REG_CURSOR_X_HIGH, + (((col + 8) * adp->va_info.vi_cwidth) >> 8) & 0x0f); + sc->gfbc->ramdac_wr(sc, BT485_REG_CURSOR_Y_LOW, + ((row + 4) * adp->va_info.vi_cheight) & 0xff); + sc->gfbc->ramdac_wr(sc, BT485_REG_CURSOR_Y_HIGH, + (((row + 4) * adp->va_info.vi_cheight) >> 8) & 0x0f); + splx(s); + } + return(error); +} + +static int +bt485_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, + int cellsize, int blink) +{ + struct gfb_softc *sc; + int error, cell_count, count, i, j; + u_int8_t regval; + + error = 0; + cellsize /= 2; + sc = gfb_device_softcs[adp->va_model][adp->va_unit]; + + /* + Make sure the parameters are in range for the cursor + (it's a 64x64 cursor)... + */ + if(height > 64) + error = EINVAL; + else if(height <= 0) { + /* If height is less than or equal to 0, then hide the + cursor... */ + } else { + /* Otherwise, just resize the cursor as requested... */ + + /* 64 pixels per cursor-row, 2 bits-per-pixel, so counts in + bytes... */ + cell_count = cellsize / 8; + count = 64 / 8; + + /* + * Write the cursor image data: + * set addr[9:8] to 0, + * set addr[7:0] to 0, + * spit it all out. + */ + sc->gfbc->ramdac_wr(sc, BT485_REG_PCRAM_WRADDR, + BT485_IREG_COMMAND_3); + regval = sc->gfbc->ramdac_rd(sc, BT485_REG_EXTENDED); + regval &= ~0x03; + sc->gfbc->ramdac_wr(sc, BT485_REG_PCRAM_WRADDR, + BT485_IREG_COMMAND_3); + sc->gfbc->ramdac_wr(sc, BT485_REG_EXTENDED, regval); + sc->gfbc->ramdac_wr(sc, BT485_REG_PCRAM_WRADDR, 0); + + /* Fill-in the desired pixels in the specified pixel-rows... */ + for(i = 0; i < height; i++) { + for(j = 0; j < cell_count; j++) + sc->gfbc->ramdac_wr(sc, BT485_REG_CURSOR_RAM, + 0xff); + for(j = 0; j < count - cell_count; j++) + sc->gfbc->ramdac_wr(sc, BT485_REG_CURSOR_RAM, + 0x00); + } + + /* Clear the remaining pixel rows... */ + for(; i < 64; i++) + for(j = 0; j < count; j++) + sc->gfbc->ramdac_wr(sc, BT485_REG_CURSOR_RAM, + 0x00); + + /* + * Write the cursor mask data: + * set addr[9:8] to 2, + * set addr[7:0] to 0, + * spit it all out. + */ + sc->gfbc->ramdac_wr(sc, BT485_REG_PCRAM_WRADDR, + BT485_IREG_COMMAND_3); + regval = sc->gfbc->ramdac_rd(sc, BT485_REG_EXTENDED); + regval &= ~0x03; regval |= 0x02; + sc->gfbc->ramdac_wr(sc, BT485_REG_PCRAM_WRADDR, + BT485_IREG_COMMAND_3); + sc->gfbc->ramdac_wr(sc, BT485_REG_EXTENDED, regval); + sc->gfbc->ramdac_wr(sc, BT485_REG_PCRAM_WRADDR, 0); + + /* Fill-in the desired pixels in the specified pixel-rows... */ + for(i = 0; i < height; i++) { + for(j = 0; j < cell_count; j++) + sc->gfbc->ramdac_wr(sc, BT485_REG_CURSOR_RAM, + 0xff); + for(j = 0; j < count - cell_count; j++) + sc->gfbc->ramdac_wr(sc, BT485_REG_CURSOR_RAM, + 0x00); + } + + /* Clear the remaining pixel rows... */ + for(; i < 64; i++) + for(j = 0; j < count; j++) + sc->gfbc->ramdac_wr(sc, BT485_REG_CURSOR_RAM, + 0x00); + + /* set addr[9:0] back to 0 */ + sc->gfbc->ramdac_wr(sc, BT485_REG_PCRAM_WRADDR, + BT485_IREG_COMMAND_3); + regval = sc->gfbc->ramdac_rd(sc, BT485_REG_EXTENDED); + regval &= ~0x03; + sc->gfbc->ramdac_wr(sc, BT485_REG_PCRAM_WRADDR, + BT485_IREG_COMMAND_3); + sc->gfbc->ramdac_wr(sc, BT485_REG_EXTENDED, regval); + } + return(error); +} + +static void +ibm561_init(struct gfb_softc *sc) +{ +} + +static int +ibm561_save_palette(video_adapter_t *adp, video_color_palette_t *palette) +{ + int error; + + error = 0; + return(error); +} + +static int +ibm561_load_palette(video_adapter_t *adp, video_color_palette_t *palette) +{ + int error; + + error = 0; + return(error); +} + +static int +ibm561_save_cursor_palette(video_adapter_t *adp, struct fbcmap *palette) +{ + int error; + + error = 0; + return(error); +} + +static int +ibm561_load_cursor_palette(video_adapter_t *adp, struct fbcmap *palette) +{ + int error; + + error = 0; + return(error); +} + +#undef MB +#undef KB diff --git a/sys/dev/fb/tga.h b/sys/dev/fb/tga.h new file mode 100644 index 0000000..2830248 --- /dev/null +++ b/sys/dev/fb/tga.h @@ -0,0 +1,155 @@ +/* + * Copyright (c) 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + * + * Copyright (c) 2000 Andrew Miklic + * + * $FreeBSD$ + */ + +#ifndef _FB_TGA_H_ +#define _FB_TGA_H_ + +/* TGA-specific FB stuff */ + +struct gfb_softc; +struct video_adapter; + +/* + * Register definitions for the Brooktree Bt463 135MHz Monolithic + * CMOS TrueVu RAMDAC. + */ + +/* + * Directly-accessible registers. Note the address register is + * auto-incrementing. + */ +#define BT463_REG_ADDR_LOW 0x00 /* C1,C0 == 0,0 */ +#define BT463_REG_ADDR_HIGH 0x01 /* C1,C0 == 0,1 */ +#define BT463_REG_IREG_DATA 0x02 /* C1,C0 == 1,0 */ +#define BT463_REG_CMAP_DATA 0x03 /* C1,C0 == 1,1 */ + +#define BT463_REG_MAX BT463_REG_CMAP_DATA + +/* + * All internal register access to the Bt463 is done indirectly via the + * Address Register (mapped into the host bus in a device-specific + * fashion). The following register definitions are in terms of + * their address register address values. + */ + +/* C1,C0 must be 1,0 */ +#define BT463_IREG_CURSOR_COLOR_0 0x0100 /* 3 r/w cycles */ +#define BT463_IREG_CURSOR_COLOR_1 0x0101 /* 3 r/w cycles */ +#define BT463_IREG_ID 0x0200 +#define BT463_IREG_COMMAND_0 0x0201 +#define BT463_IREG_COMMAND_1 0x0202 +#define BT463_IREG_COMMAND_2 0x0203 +#define BT463_IREG_READ_MASK_P0_P7 0x0205 +#define BT463_IREG_READ_MASK_P8_P15 0x0206 +#define BT463_IREG_READ_MASK_P16_P23 0x0207 +#define BT463_IREG_READ_MASK_P24_P27 0x0208 +#define BT463_IREG_BLINK_MASK_P0_P7 0x0209 +#define BT463_IREG_BLINK_MASK_P8_P15 0x020a +#define BT463_IREG_BLINK_MASK_P16_P23 0x020b +#define BT463_IREG_BLINK_MASK_P24_P27 0x020c +#define BT463_IREG_TEST 0x020d +#define BT463_IREG_INPUT_SIG 0x020e /* 2 of 3 r/w cycles */ +#define BT463_IREG_OUTPUT_SIG 0x020f /* 3 r/w cycles */ +#define BT463_IREG_REVISION 0x0220 +#define BT463_IREG_WINDOW_TYPE_TABLE 0x0300 /* 3 r/w cycles */ + +#define BT463_NWTYPE_ENTRIES 0x10 /* 16 window type entries */ + +/* C1,C0 must be 1,1 */ +#define BT463_IREG_CPALETTE_RAM 0x0000 /* 3 r/w cycles */ + +#define BT463_NCMAP_ENTRIES 0x210 /* 528 CMAP entries */ + +#define BT463_DATA_CURCMAP_CHANGED 0x01 /* cursor colormap changed */ +#define BT463_DATA_CMAP_CHANGED 0x02 /* colormap changed */ +#define BT463_DATA_WTYPE_CHANGED 0x04 /* window type table changed */ +#define BT463_DATA_ALL_CHANGED 0x07 + +/* + * Register definitions for the Brooktree Bt485A 170MHz Monolithic + * CMOS True-Color RAMDAC. + */ + +/* + * Directly-addressed registers. + */ + +#define BT485_REG_PCRAM_WRADDR 0x00 +#define BT485_REG_PALETTE 0x01 +#define BT485_REG_PIXMASK 0x02 +#define BT485_REG_PCRAM_RDADDR 0x03 +#define BT485_REG_COC_WRADDR 0x04 +#define BT485_REG_COCDATA 0x05 +#define BT485_REG_COMMAND_0 0x06 +#define BT485_REG_COC_RDADDR 0x07 +#define BT485_REG_COMMAND_1 0x08 +#define BT485_REG_COMMAND_2 0x09 +#define BT485_REG_STATUS 0x0a +#define BT485_REG_EXTENDED BT485_REG_STATUS +#define BT485_REG_CURSOR_RAM 0x0b +#define BT485_REG_CURSOR_X_LOW 0x0c +#define BT485_REG_CURSOR_X_HIGH 0x0d +#define BT485_REG_CURSOR_Y_LOW 0x0e +#define BT485_REG_CURSOR_Y_HIGH 0x0f + +#define BT485_REG_MAX 0x0f + +#define BT485_IREG_STATUS 0x00 +#define BT485_IREG_COMMAND_3 0x01 +#define BT485_IREG_COMMAND_4 0x02 +#define BT485_IREG_RSA 0x20 +#define BT485_IREG_GSA 0x21 +#define BT485_IREG_BSA 0x22 + +#define BT485_DATA_ENB_CHANGED 0x01 /* cursor enable changed */ +#define BT485_DATA_CURCMAP_CHANGED 0x02 /* cursor colormap changed */ +#define BT485_DATA_CURSHAPE_CHANGED 0x04 /* cursor size, image, mask changed */ +#define BT485_DATA_CMAP_CHANGED 0x08 /* colormap changed */ +#define BT485_DATA_ALL_CHANGED 0x0f +#define CURSOR_MAX_SIZE 64 + +#define TGA_DRIVER_NAME "tga" +#define TGA2_DRIVER_NAME "tga2" + +#define BTWREG(sc, addr, val) \ + sc->gfbc->ramdac_wr((sc), BT463_REG_ADDR_LOW, (addr) & 0xff); \ + sc->gfbc->ramdac_wr((sc), BT463_REG_ADDR_HIGH, ((addr) >> 8) & 0xff);\ + (sc)->gfbc->ramdac_wr((sc), BT463_REG_IREG_DATA, (val)) +#define BTWNREG(sc, val) \ + (sc)->gfbc->ramdac_wr((sc), BT463_REG_IREG_DATA, (val)) +#define BTRREG(sc, addr) \ + sc->gfbc->ramdac_wr((sc), BT463_REG_ADDR_LOW, (addr) & 0xff); \ + sc->gfbc->ramdac_wr((sc), BT463_REG_ADDR_HIGH, ((addr) >> 8) & 0xff);\ + (sc)->gfbc->ramdac_rd((sc), BT463_REG_IREG_DATA) +#define BTRNREG(sc) \ + (sc)->gfbc->ramdac_rd((sc), BT463_REG_IREG_DATA) + +#endif /* _FB_TGA_H_ */ diff --git a/sys/dev/gfb/gfb_pci.c b/sys/dev/gfb/gfb_pci.c new file mode 100644 index 0000000..3ed3183 --- /dev/null +++ b/sys/dev/gfb/gfb_pci.c @@ -0,0 +1,322 @@ +/* + * Copyright (c) 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + * + * Copyright (c) 2000 Andrew Miklic, Andrew Gallatin, and Thomas V. Crimi + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/conf.h> +#include <sys/proc.h> +#include <sys/fcntl.h> +#include <sys/malloc.h> +#include <sys/fbio.h> + +#include <vm/vm.h> +#include <vm/vm_param.h> +#include <vm/pmap.h> + +#include <machine/md_var.h> +#include <machine/pc/bios.h> +#include <machine/clock.h> +#include <machine/bus_memio.h> +#include <machine/bus.h> +#include <machine/pc/vesa.h> +#include <machine/resource.h> + +#include <sys/bus.h> +#include <sys/rman.h> + +#include <pci/pcireg.h> +#include <pci/pcivar.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/gfb.h> +#include <dev/gfb/gfb_pci.h> + +#ifdef __alpha__ + +#include <machine/rpb.h> +#include <machine/cpu.h> + +#endif /* __alpha__ */ + +#include "opt_fb.h" + +static devclass_t gfb_devclass; + +#ifdef __alpha__ + +extern void sccnattach(void); + +#endif /* __alpha__ */ + +extern struct gfb_font bold8x16; +extern struct gfb_softc *gfb_device_softcs[2][16]; + +int +pcigfb_attach(device_t dev) +{ + int s; + gfb_softc_t sc; + video_adapter_t *adp; + int unit, flags, error, rid, va_index; +#ifdef __alpha__ + struct ctb *ctb; +#endif /* __alpha__ */ + + s = splimp(); + error = 0; + unit = device_get_unit(dev); + flags = device_get_flags(dev); + sc = device_get_softc(dev); + sc->rev = pci_get_revid(dev); + rid = GFB_MEM_BASE_RID; + sc->res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, + RF_ACTIVE|PCI_RF_DENSE); + if(sc->res == NULL) { + device_printf(dev, "couldn't map memory\n"); + goto fail; + } + sc->btag = rman_get_bustag(sc->res); + sc->bhandle = rman_get_bushandle(sc->res); + + /* Allocate interrupt (irq)... */ + rid = 0x0; + sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + RF_SHAREABLE|RF_ACTIVE); + if(sc->irq == NULL) { + device_printf(dev, "Couldn't map interrupt\n"); + goto fail; + } + if((va_index = vid_find_adapter(sc->driver_name, unit)) < 0) { + sc->adp = (video_adapter_t *)malloc(sizeof(video_adapter_t), + M_DEVBUF, M_NOWAIT); + adp = sc->adp; + bzero(adp, sizeof(video_adapter_t)); + vid_init_struct(adp, sc->driver_name, sc->type, unit); + if(vid_register(adp) < 0) { + free(sc->adp, M_DEVBUF); + goto fail; + } + adp->va_flags |= V_ADP_REGISTERED; + adp->va_model = sc->model; + adp->va_mem_base = (vm_offset_t)rman_get_virtual(sc->res); + adp->va_mem_size = rman_get_end(sc->res) - + rman_get_start(sc->res); + adp->va_io_base = NULL; + adp->va_io_size = 0; + adp->va_crtc_addr = NULL; + gfb_device_softcs[sc->model][unit] = sc; + sc->gfbc = (struct gfb_conf *)malloc(sizeof(struct gfb_conf), + M_DEVBUF, M_NOWAIT); + bzero(sc->gfbc, sizeof(struct gfb_conf)); + if((*vidsw[adp->va_index]->init)(unit, adp, flags)) { + device_printf(dev, "Couldn't initialize adapter\n"); + vid_unregister(adp); + gfb_device_softcs[sc->model][unit] = NULL; + free(sc->gfbc, M_DEVBUF); + free(sc->adp, M_DEVBUF); + goto fail; + } + sc->gfbc->palette.red = + (u_char *)malloc(sc->gfbc->palette.count, M_DEVBUF, + M_NOWAIT); + sc->gfbc->palette.green = + (u_char *)malloc(sc->gfbc->palette.count, M_DEVBUF, + M_NOWAIT); + sc->gfbc->palette.blue = + (u_char *)malloc(sc->gfbc->palette.count, M_DEVBUF, + M_NOWAIT); + sc->gfbc->cursor_palette.red = + (u_char *)malloc(sc->gfbc->cursor_palette.count, M_DEVBUF, + M_NOWAIT); + sc->gfbc->cursor_palette.green = + (u_char *)malloc(sc->gfbc->cursor_palette.count, M_DEVBUF, + M_NOWAIT); + sc->gfbc->cursor_palette.blue = + (u_char *)malloc(sc->gfbc->cursor_palette.count, M_DEVBUF, + M_NOWAIT); + if(gfb_init(unit, adp, flags)) { + device_printf(dev, "Couldn't initialize framebuffer\n"); + vid_unregister(adp); + gfb_device_softcs[sc->model][unit] = NULL; + free(sc->gfbc->cursor_palette.blue, M_DEVBUF); + free(sc->gfbc->cursor_palette.green, M_DEVBUF); + free(sc->gfbc->cursor_palette.red, M_DEVBUF); + free(sc->gfbc->palette.blue, M_DEVBUF); + free(sc->gfbc->palette.green, M_DEVBUF); + free(sc->gfbc->palette.red, M_DEVBUF); + free(sc->gfbc, M_DEVBUF); + free(sc->adp, M_DEVBUF); + goto fail; + } + } else { + (*vidsw[va_index]->probe)(unit, &adp, (void *)sc->driver_name, + flags); + sc->adp = adp; + sc->gfbc = gfb_device_softcs[sc->model][unit]->gfbc; + gfb_device_softcs[sc->model][unit] = sc; + } + + /* + This is a back-door for PCI devices--since FreeBSD no longer supports + PCI configuration-space accesses during the *configure() phase for + video adapters, we cannot identify a PCI device as the console during + the first call to sccnattach(). There must be a second chance for PCI + adapters to be recognized as the console, and this is it... + */ +#ifdef __alpha__ + ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); + if (ctb->ctb_term_type == 3) /* Display adapter */ + sccnattach(); +#endif /* __alpha__ */ + + device_printf(dev, "Board type %s\n", sc->gfbc->name); + device_printf(dev, "%d x %d, %dbpp, %s RAMDAC\n", + sc->adp->va_info.vi_width, sc->adp->va_info.vi_height, + sc->adp->va_info.vi_depth, sc->gfbc->ramdac_name); +#ifdef FB_INSTALL_CDEV + /* attach a virtual frame buffer device */ + error = fb_attach(makedev(0, unit), sc->adp, sc->cdevsw); + if(error) + goto fail; + if(bootverbose) + (*vidsw[sc->adp->va_index]->diag)(sc->adp, bootverbose); +#if experimental + device_add_child(dev, "fb", -1); + bus_generic_attach(dev); +#endif /*experimental*/ +#endif /*FB_INSTALL_CDEV*/ + goto done; +fail: + if(sc->intrhand != NULL) { + bus_teardown_intr(dev, sc->irq, sc->intrhand); + sc->intrhand = NULL; + } + if(sc->irq != NULL) { + rid = 0x0; + bus_release_resource(dev, SYS_RES_IRQ, rid, sc->irq); + sc->irq = NULL; + } + if(sc->res != NULL) { + rid = GFB_MEM_BASE_RID; + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->res); + sc->res = NULL; + } + error = ENXIO; +done: + splx(s); + return(error); +} + +int +pcigfb_detach(device_t dev) +{ + struct gfb_softc *sc; + int rid; + + sc = device_get_softc(dev); +#ifdef FB_INSTALL_CDEV + destroy_dev(sc->devt); +#endif /*FB_INSTALL_CDEV*/ + bus_teardown_intr(dev, sc->irq, sc->intrhand); + rid = 0x0; + bus_release_resource(dev, SYS_RES_IRQ, rid, sc->irq); + rid = GFB_MEM_BASE_RID; + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->res); + return(0); +} + +#ifdef FB_INSTALL_CDEV + +int +pcigfb_open(dev_t dev, int flag, int mode, struct proc *p) +{ + struct gfb_softc *sc; + int error; + + sc = (struct gfb_softc *)devclass_get_softc(gfb_devclass, minor(dev)); + + if(sc == NULL) + error = ENXIO; + else if(mode & (O_CREAT | O_APPEND | O_TRUNC)) + error = ENODEV; + else + error = genfbopen(&sc->gensc, sc->adp, flag, mode, p); + return(error); +} + +int +pcigfb_close(dev_t dev, int flag, int mode, struct proc *p) +{ + struct gfb_softc *sc; + + sc = (struct gfb_softc *)devclass_get_softc(gfb_devclass, minor(dev)); + return genfbclose(&sc->gensc, sc->adp, flag, mode, p); +} + +int +pcigfb_read(dev_t dev, struct uio *uio, int flag) +{ + struct gfb_softc *sc; + + sc = (struct gfb_softc *)devclass_get_softc(gfb_devclass, minor(dev)); + return genfbread(&sc->gensc, sc->adp, uio, flag); +} + +int +pcigfb_write(dev_t dev, struct uio *uio, int flag) +{ + struct gfb_softc *sc; + + sc = (struct gfb_softc *)devclass_get_softc(gfb_devclass, minor(dev)); + return genfbwrite(&sc->gensc, sc->adp, uio, flag); +} + +int +pcigfb_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p) +{ + struct gfb_softc *sc; + + sc = (struct gfb_softc *)devclass_get_softc(gfb_devclass, minor(dev)); + return genfbioctl(&sc->gensc, sc->adp, cmd, arg, flag, p); +} + +int +pcigfb_mmap(dev_t dev, vm_offset_t offset, int prot) +{ + struct gfb_softc *sc; + + sc = (struct gfb_softc *)devclass_get_softc(gfb_devclass, minor(dev)); + return genfbmmap(&sc->gensc, sc->adp, offset, prot); +} + +#endif /*FB_INSTALL_CDEV*/ diff --git a/sys/dev/gfb/gfb_pci.h b/sys/dev/gfb/gfb_pci.h new file mode 100644 index 0000000..e0f517e --- /dev/null +++ b/sys/dev/gfb/gfb_pci.h @@ -0,0 +1,114 @@ +/* + * Copyright (c) 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + * + * Copyright (c) 2000 Andrew Miklic + * + * $FreeBSD$ + */ + +#ifndef _PCI_GFB_H_ +#define _PCI_GFB_H_ + +#define GFB_MEM_BASE_RID 0x10 + +typedef u_int32_t gfb_reg_t; + +/* GFB register access macros */ + +#define BUFADDR(adp, off) \ +/* (adp)->va_buffer = (adp)->va_mem_base + \ + (((adp)->va_buffer - \ + (adp)->va_mem_base + \ + (adp)->va_buffer_size) % \ + (adp)->va_mem_size), \ + (adp)->va_buffer_alias = ((adp)->va_buffer - \ + (adp)->va_mem_base) / \ + (adp)->va_buffer_size, \ + (adp)->va_window = (adp)->va_buffer + \ + (((adp)->va_window - \ + (adp)->va_mem_base) / \ + (adp)->va_buffer_alias), \ +*/ ((adp)->va_window + (adp)->va_window_orig + \ + ((vm_offset_t)(off) << 2L)) + +#define REGADDR(adp, reg) \ +/* (adp)->va_buffer = (adp)->va_mem_base + \ + (((adp)->va_buffer - \ + (adp)->va_mem_base + \ + (adp)->va_buffer_size) % \ + (adp)->va_mem_size), \ + (adp)->va_buffer_alias = ((adp)->va_buffer - \ + (adp)->va_mem_base) / \ + (adp)->va_buffer_size, \ + (adp)->va_registers = (adp)->va_buffer + \ + (((adp)->va_registers - \ + (adp)->va_mem_base) / \ + (adp)->va_buffer_alias), \ +*/ ((adp)->va_registers + ((vm_offset_t)(reg) << 2L)) + +#define READ_GFB_REGISTER(adp, reg) \ + (*(u_int32_t *)(REGADDR(adp, reg))) +#define WRITE_GFB_REGISTER(adp, reg, val) \ + (*(u_int32_t*)(REGADDR(adp, reg)) = (val)) +#define GFB_REGISTER_WRITE_BARRIER(sc, reg, nregs) \ + bus_space_barrier((sc)->btag, (sc)->regs, ((reg) << 2), \ + 4 * (nregs), BUS_SPACE_BARRIER_WRITE) +#define GFB_REGISTER_READ_BARRIER(sc, reg, nregs) \ + bus_space_barrier((sc)->btag, (sc)->regs, ((reg) << 2), \ + 4 * (nregs), BUS_SPACE_BARRIER_READ) +#define GFB_REGISTER_READWRITE_BARRIER(sc, reg, nregs) \ + bus_space_barrier((sc)->btag, (sc)->regs, ((reg) << 2), \ + 4 * (nregs), \ + BUS_SPACE_BARRIER_READ | \ + BUS_SPACE_BARRIER_WRITE) + +#define READ_GFB_BUFFER(adp, reg) \ + (*(u_int32_t *)(BUFADDR(adp, reg))) +#define WRITE_GFB_BUFFER(adp, reg, val) \ + (*(u_int32_t*)(BUFADDR(adp, reg)) = (val)) + +/*int pcigfb_probe(device_t);*/ +int pcigfb_attach(device_t); +int pcigfb_detach(device_t); + +#ifdef FB_INSTALL_CDEV + +d_open_t pcigfb_open; +d_close_t pcigfb_close; +d_read_t pcigfb_read; +d_write_t pcigfb_write; +d_ioctl_t pcigfb_ioctl; +d_mmap_t pcigfb_mmap; + +#endif /*FB_INSTALL_CDEV*/ + +typedef struct gfb_type { + int vendor_id; + int device_id; + char* name; +} *gfb_type_t; + +#endif /* _PCI_GFB_H_ */ diff --git a/sys/dev/syscons/scgfbrndr.c b/sys/dev/syscons/scgfbrndr.c index e14341f..86e2444 100644 --- a/sys/dev/syscons/scgfbrndr.c +++ b/sys/dev/syscons/scgfbrndr.c @@ -23,11 +23,14 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD$ + * Copyright (c) 2000 Andrew Miklic */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include "opt_syscons.h" -#include "opt_vga.h" +#include "opt_gfb.h" #include <sys/param.h> #include <sys/systm.h> @@ -38,666 +41,243 @@ #include <machine/bus.h> #include <dev/fb/fbreg.h> -#include <dev/fb/vgareg.h> #include <dev/syscons/syscons.h> -#include <isa/isareg.h> - #ifndef SC_RENDER_DEBUG #define SC_RENDER_DEBUG 0 #endif -static vr_clear_t vga_txtclear; -static vr_draw_border_t vga_txtborder; -static vr_draw_t vga_txtdraw; -static vr_set_cursor_t vga_txtcursor_shape; -static vr_draw_cursor_t vga_txtcursor; -static vr_blink_cursor_t vga_txtblink; +static vr_clear_t gfb_clear; +static vr_draw_border_t gfb_border; +static vr_draw_t gfb_draw; +static vr_set_cursor_t gfb_cursor_shape; +static vr_draw_cursor_t gfb_cursor; +static vr_blink_cursor_t gfb_blink; #ifndef SC_NO_CUTPASTE -static vr_draw_mouse_t vga_txtmouse; +static vr_draw_mouse_t gfb_mouse; #else -#define vga_txtmouse (vr_draw_mouse_t *)vga_nop -#endif - -#ifdef SC_PIXEL_MODE -static vr_clear_t vga_pxlclear; -static vr_draw_border_t vga_pxlborder; -static vr_draw_t vga_egadraw; -static vr_draw_t vga_vgadraw; -static vr_set_cursor_t vga_pxlcursor_shape; -static vr_draw_cursor_t vga_pxlcursor; -static vr_blink_cursor_t vga_pxlblink; -#ifndef SC_NO_CUTPASTE -static vr_draw_mouse_t vga_pxlmouse; -#else -#define vga_pxlmouse (vr_draw_mouse_t *)vga_nop -#endif -#endif /* SC_PIXEL_MODE */ - -#ifndef SC_NO_MODE_CHANGE -static vr_draw_border_t vga_grborder; +#define gfb_mouse (vr_draw_mouse_t *)gfb_nop #endif -static void vga_nop(scr_stat *scp, ...); - -static sc_rndr_sw_t txtrndrsw = { - vga_txtclear, - vga_txtborder, - vga_txtdraw, - vga_txtcursor_shape, - vga_txtcursor, - vga_txtblink, - (vr_set_mouse_t *)vga_nop, - vga_txtmouse, +static void gfb_nop(scr_stat *scp, ...); + +sc_rndr_sw_t txtrndrsw = { + gfb_clear, + gfb_border, + gfb_draw, + gfb_cursor_shape, + gfb_cursor, + gfb_blink, + (vr_set_mouse_t *)gfb_nop, + gfb_mouse, }; -RENDERER(mda, 0, txtrndrsw, vga_set); -RENDERER(cga, 0, txtrndrsw, vga_set); -RENDERER(ega, 0, txtrndrsw, vga_set); -RENDERER(vga, 0, txtrndrsw, vga_set); #ifdef SC_PIXEL_MODE -static sc_rndr_sw_t egarndrsw = { - vga_pxlclear, - vga_pxlborder, - vga_egadraw, - vga_pxlcursor_shape, - vga_pxlcursor, - vga_pxlblink, - (vr_set_mouse_t *)vga_nop, - vga_pxlmouse, +sc_rndr_sw_t gfbrndrsw = { + gfb_clear, + gfb_border, + gfb_draw, + gfb_cursor_shape, + gfb_cursor, + gfb_blink, + (vr_set_mouse_t *)gfb_nop, + gfb_mouse, }; -RENDERER(ega, PIXEL_MODE, egarndrsw, vga_set); - -static sc_rndr_sw_t vgarndrsw = { - vga_pxlclear, - vga_pxlborder, - vga_vgadraw, - vga_pxlcursor_shape, - vga_pxlcursor, - vga_pxlblink, - (vr_set_mouse_t *)vga_nop, - vga_pxlmouse, -}; -RENDERER(vga, PIXEL_MODE, vgarndrsw, vga_set); #endif /* SC_PIXEL_MODE */ #ifndef SC_NO_MODE_CHANGE -static sc_rndr_sw_t grrndrsw = { - (vr_clear_t *)vga_nop, - vga_grborder, - (vr_draw_t *)vga_nop, - (vr_set_cursor_t *)vga_nop, - (vr_draw_cursor_t *)vga_nop, - (vr_blink_cursor_t *)vga_nop, - (vr_set_mouse_t *)vga_nop, - (vr_draw_mouse_t *)vga_nop, +sc_rndr_sw_t grrndrsw = { + (vr_clear_t *)gfb_nop, + gfb_border, + (vr_draw_t *)gfb_nop, + (vr_set_cursor_t *)gfb_nop, + (vr_draw_cursor_t *)gfb_nop, + (vr_blink_cursor_t *)gfb_nop, + (vr_set_mouse_t *)gfb_nop, + (vr_draw_mouse_t *)gfb_nop, }; -RENDERER(cga, GRAPHICS_MODE, grrndrsw, vga_set); -RENDERER(ega, GRAPHICS_MODE, grrndrsw, vga_set); -RENDERER(vga, GRAPHICS_MODE, grrndrsw, vga_set); #endif /* SC_NO_MODE_CHANGE */ -RENDERER_MODULE(vga, vga_set); - #ifndef SC_NO_CUTPASTE -static u_short mouse_and_mask[16] = { - 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00, 0xff80, - 0xfe00, 0x1e00, 0x1f00, 0x0f00, 0x0f00, 0x0000, 0x0000, 0x0000 -}; -static u_short mouse_or_mask[16] = { - 0x0000, 0x4000, 0x6000, 0x7000, 0x7800, 0x7c00, 0x7e00, 0x6800, - 0x0c00, 0x0c00, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000 + +static u_char mouse_pointer[16] = { + 0x00, 0x40, 0x60, 0x70, 0x78, 0x7c, 0x7e, 0x68, + 0x0c, 0x0c, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00 }; #endif static void -vga_nop(scr_stat *scp, ...) +gfb_nop(scr_stat *scp, ...) { } /* text mode renderer */ static void -vga_txtclear(scr_stat *scp, int c, int attr) +gfb_clear(scr_stat *scp, int c, int attr) { - sc_vtb_clear(&scp->scr, c, attr); + (*vidsw[scp->sc->adapter]->clear)(scp->sc->adp); } static void -vga_txtborder(scr_stat *scp, int color) +gfb_border(scr_stat *scp, int color) { (*vidsw[scp->sc->adapter]->set_border)(scp->sc->adp, color); } static void -vga_txtdraw(scr_stat *scp, int from, int count, int flip) +gfb_draw(scr_stat *scp, int from, int count, int flip) { - vm_offset_t p; - int c; - int a; - - if (from + count > scp->xsize*scp->ysize) - count = scp->xsize*scp->ysize - from; - - if (flip) { - for (p = sc_vtb_pointer(&scp->scr, from); count-- > 0; ++from) { - c = sc_vtb_getc(&scp->vtb, from); - a = sc_vtb_geta(&scp->vtb, from); - a = (a & 0x8800) | ((a & 0x7000) >> 4) - | ((a & 0x0700) << 4); - p = sc_vtb_putchar(&scp->scr, p, c, a); + char c; + char a; + int i, n; + video_adapter_t *adp; + + adp = scp->sc->adp; + + /* + Determine if we need to scroll based on the offset + and the number of characters to be displayed... + */ + if (from + count > scp->xsize*scp->ysize) { + + /* + Calculate the number of characters past the end of the + visible screen... + */ + count = (from + count) - + (adp->va_info.vi_width * adp->va_info.vi_height); + + /* + Calculate the number of rows past the end of the visible + screen... + */ + n = (count / adp->va_info.vi_width) + 1; + + /* Scroll to make room for new text rows... */ + (*vidsw[scp->sc->adapter]->copy)(adp, n, 0, n); +#ifdef 0 + (*vidsw[scp->sc->adapter]->clear)(adp, n); +#endif + + /* Display new text rows... */ + (*vidsw[scp->sc->adapter]->puts)(adp, from, + (u_int16_t *)sc_vtb_pointer(&scp->vtb, from), count); + } + + /* + We don't need to scroll, so we can just put the characters + all-at-once... + */ + else { + + /* + Determine the method by which we are to display characters + (are we going to print forwards or backwards? + do we need to do a character-by-character copy, then?)... + */ + if (flip) + for (i = count; i-- > 0; ++from) { + c = sc_vtb_getc(&scp->vtb, from); + a = sc_vtb_geta(&scp->vtb, from) >> 8; + (*vidsw[scp->sc->adapter]->putc)(adp, from, c, + a); + } + else { + (*vidsw[scp->sc->adapter]->puts)(adp, from, + (u_int16_t *)sc_vtb_pointer(&scp->vtb, from), + count); } - } else { - sc_vtb_copy(&scp->vtb, from, &scp->scr, from, count); } } static void -vga_txtcursor_shape(scr_stat *scp, int base, int height, int blink) +gfb_cursor_shape(scr_stat *scp, int base, int height, int blink) { if (base < 0 || base >= scp->font_size) return; /* the caller may set height <= 0 in order to disable the cursor */ #if 0 - scp->curs_attr.base = base; - scp->curs_attr.height = height; + scp->cursor_base = base; + scp->cursor_height = height; #endif (*vidsw[scp->sc->adapter]->set_hw_cursor_shape)(scp->sc->adp, - base, height, - scp->font_size, blink); + base, height, scp->font_size, blink); } -static void -draw_txtcharcursor(scr_stat *scp, int at, u_short c, u_short a, int flip) -{ - sc_softc_t *sc; - - sc = scp->sc; - scp->cursor_saveunder_char = c; - scp->cursor_saveunder_attr = a; - -#ifndef SC_NO_FONT_LOADING - if (scp->curs_attr.flags & CONS_CHAR_CURSOR) { - unsigned char *font; - int h; - int i; - - if (scp->font_size < 14) { - font = sc->font_8; - h = 8; - } else if (scp->font_size >= 16) { - font = sc->font_16; - h = 16; - } else { - font = sc->font_14; - h = 14; - } - if (scp->curs_attr.base >= h) - return; - if (flip) - a = (a & 0x8800) - | ((a & 0x7000) >> 4) | ((a & 0x0700) << 4); - bcopy(font + c*h, font + sc->cursor_char*h, h); - font = font + sc->cursor_char*h; - for (i = imax(h - scp->curs_attr.base - scp->curs_attr.height, 0); - i < h - scp->curs_attr.base; ++i) { - font[i] ^= 0xff; - } - /* XXX */ - (*vidsw[sc->adapter]->load_font)(sc->adp, 0, h, font, - sc->cursor_char, 1); - sc_vtb_putc(&scp->scr, at, sc->cursor_char, a); - } else -#endif /* SC_NO_FONT_LOADING */ - { - if ((a & 0x7000) == 0x7000) { - a &= 0x8f00; - if ((a & 0x0700) == 0) - a |= 0x0700; - } else { - a |= 0x7000; - if ((a & 0x0700) == 0x0700) - a &= 0xf000; - } - if (flip) - a = (a & 0x8800) - | ((a & 0x7000) >> 4) | ((a & 0x0700) << 4); - sc_vtb_putc(&scp->scr, at, c, a); - } -} +static int pxlblinkrate = 0; +#ifdef 0 static void -vga_txtcursor(scr_stat *scp, int at, int blink, int on, int flip) +gfb_cursor(scr_stat *scp, int at, int blink, int on, int flip) { video_adapter_t *adp; - int cursor_attr; - if (scp->curs_attr.height <= 0) /* the text cursor is disabled */ + if (scp->cursor_height <= 0) /* the text cursor is disabled */ return; adp = scp->sc->adp; - if (blink) { + if(blink) { scp->status |= VR_CURSOR_BLINK; if (on) { scp->status |= VR_CURSOR_ON; (*vidsw[adp->va_index]->set_hw_cursor)(adp, - at%scp->xsize, - at/scp->xsize); + at%scp->xsize, + at/scp->xsize); } else { if (scp->status & VR_CURSOR_ON) - (*vidsw[adp->va_index]->set_hw_cursor)(adp, - -1, -1); + (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, + -1); scp->status &= ~VR_CURSOR_ON; } } else { scp->status &= ~VR_CURSOR_BLINK; - if (on) { + if(on) { scp->status |= VR_CURSOR_ON; - draw_txtcharcursor(scp, at, - sc_vtb_getc(&scp->scr, at), - sc_vtb_geta(&scp->scr, at), - flip); + scp->cursor_saveunder_char = sc_vtb_getc(&scp->scr, at); + scp->cursor_saveunder_attr = sc_vtb_geta(&scp->scr, at); + (*vidsw[scp->sc->adapter]->putc)(scp->sc->adp, at, + scp->cursor_saveunder_char, + scp->cursor_saveunder_attr); } else { - cursor_attr = scp->cursor_saveunder_attr; - if (flip) - cursor_attr = (cursor_attr & 0x8800) - | ((cursor_attr & 0x7000) >> 4) - | ((cursor_attr & 0x0700) << 4); if (scp->status & VR_CURSOR_ON) - sc_vtb_putc(&scp->scr, at, - scp->cursor_saveunder_char, - cursor_attr); + (*vidsw[scp->sc->adapter]->putc)(scp->sc->adp, + at, scp->cursor_saveunder_char, + scp->cursor_saveunder_attr); scp->status &= ~VR_CURSOR_ON; } } } - -static void -vga_txtblink(scr_stat *scp, int at, int flip) -{ -} - -#ifndef SC_NO_CUTPASTE - -static void -draw_txtmouse(scr_stat *scp, int x, int y) -{ -#ifndef SC_ALT_MOUSE_IMAGE - if (ISMOUSEAVAIL(scp->sc->adp->va_flags)) { - u_char font_buf[128]; - u_short cursor[32]; - u_char c; - int pos; - int xoffset, yoffset; - int crtc_addr; - int i; - - /* prepare mousepointer char's bitmaps */ - pos = (y/scp->font_size - scp->yoff)*scp->xsize + x/8 - scp->xoff; - bcopy(scp->font + sc_vtb_getc(&scp->scr, pos)*scp->font_size, - &font_buf[0], scp->font_size); - bcopy(scp->font + sc_vtb_getc(&scp->scr, pos + 1)*scp->font_size, - &font_buf[32], scp->font_size); - bcopy(scp->font - + sc_vtb_getc(&scp->scr, pos + scp->xsize)*scp->font_size, - &font_buf[64], scp->font_size); - bcopy(scp->font - + sc_vtb_getc(&scp->scr, pos + scp->xsize + 1)*scp->font_size, - &font_buf[96], scp->font_size); - for (i = 0; i < scp->font_size; ++i) { - cursor[i] = font_buf[i]<<8 | font_buf[i+32]; - cursor[i + scp->font_size] = font_buf[i+64]<<8 | font_buf[i+96]; - } - - /* now and-or in the mousepointer image */ - xoffset = x%8; - yoffset = y%scp->font_size; - for (i = 0; i < 16; ++i) { - cursor[i + yoffset] = - (cursor[i + yoffset] & ~(mouse_and_mask[i] >> xoffset)) - | (mouse_or_mask[i] >> xoffset); - } - for (i = 0; i < scp->font_size; ++i) { - font_buf[i] = (cursor[i] & 0xff00) >> 8; - font_buf[i + 32] = cursor[i] & 0xff; - font_buf[i + 64] = (cursor[i + scp->font_size] & 0xff00) >> 8; - font_buf[i + 96] = cursor[i + scp->font_size] & 0xff; - } - -#if 1 - /* wait for vertical retrace to avoid jitter on some videocards */ - crtc_addr = scp->sc->adp->va_crtc_addr; - while (!(inb(crtc_addr + 6) & 0x08)) /* idle */ ; -#endif - c = scp->sc->mouse_char; - (*vidsw[scp->sc->adapter]->load_font)(scp->sc->adp, 0, 32, font_buf, - c, 4); - - sc_vtb_putc(&scp->scr, pos, c, sc_vtb_geta(&scp->scr, pos)); - /* FIXME: may be out of range! */ - sc_vtb_putc(&scp->scr, pos + scp->xsize, c + 2, - sc_vtb_geta(&scp->scr, pos + scp->xsize)); - if (x < (scp->xsize - 1)*8) { - sc_vtb_putc(&scp->scr, pos + 1, c + 1, - sc_vtb_geta(&scp->scr, pos + 1)); - sc_vtb_putc(&scp->scr, pos + scp->xsize + 1, c + 3, - sc_vtb_geta(&scp->scr, pos + scp->xsize + 1)); - } - } else -#endif /* SC_ALT_MOUSE_IMAGE */ - { - /* Red, magenta and brown are mapped to green to to keep it readable */ - static const int col_conv[16] = { - 6, 6, 6, 6, 2, 2, 2, 6, 14, 14, 14, 14, 10, 10, 10, 14 - }; - int pos; - int color; - int a; - - pos = (y/scp->font_size - scp->yoff)*scp->xsize + x/8 - scp->xoff; - a = sc_vtb_geta(&scp->scr, pos); - if (scp->sc->adp->va_flags & V_ADP_COLOR) - color = (col_conv[(a & 0xf000) >> 12] << 12) - | ((a & 0x0f00) | 0x0800); - else - color = ((a & 0xf000) >> 4) | ((a & 0x0f00) << 4); - sc_vtb_putc(&scp->scr, pos, sc_vtb_getc(&scp->scr, pos), color); - } -} - -static void -remove_txtmouse(scr_stat *scp, int x, int y) -{ -} - -static void -vga_txtmouse(scr_stat *scp, int x, int y, int on) -{ - if (on) - draw_txtmouse(scp, x, y); - else - remove_txtmouse(scp, x, y); -} - -#endif /* SC_NO_CUTPASTE */ - -#ifdef SC_PIXEL_MODE - -/* pixel (raster text) mode renderer */ - -static void -vga_pxlclear(scr_stat *scp, int c, int attr) -{ - vm_offset_t p; - int line_width; - int lines; - int i; - - /* XXX: we are just filling the screen with the background color... */ - outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ - outw(GDCIDX, 0x0003); /* data rotate/function select */ - outw(GDCIDX, 0x0f01); /* set/reset enable */ - outw(GDCIDX, 0xff08); /* bit mask */ - outw(GDCIDX, ((attr & 0xf000) >> 4) | 0x00); /* set/reset */ - line_width = scp->sc->adp->va_line_width; - lines = scp->ysize*scp->font_size; - p = scp->sc->adp->va_window + line_width*scp->yoff*scp->font_size - + scp->xoff; - for (i = 0; i < lines; ++i) { - bzero_io((void *)p, scp->xsize); - p += line_width; - } - outw(GDCIDX, 0x0000); /* set/reset */ - outw(GDCIDX, 0x0001); /* set/reset enable */ -} - -static void -vga_pxlborder(scr_stat *scp, int color) -{ - vm_offset_t p; - int line_width; - int x; - int y; - int i; - - (*vidsw[scp->sc->adapter]->set_border)(scp->sc->adp, color); - - outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ - outw(GDCIDX, 0x0003); /* data rotate/function select */ - outw(GDCIDX, 0x0f01); /* set/reset enable */ - outw(GDCIDX, 0xff08); /* bit mask */ - outw(GDCIDX, (color << 8) | 0x00); /* set/reset */ - line_width = scp->sc->adp->va_line_width; - p = scp->sc->adp->va_window; - if (scp->yoff > 0) - bzero_io((void *)p, line_width*scp->yoff*scp->font_size); - y = (scp->yoff + scp->ysize)*scp->font_size; - if (scp->ypixel > y) - bzero_io((void *)(p + line_width*y), line_width*(scp->ypixel - y)); - y = scp->yoff*scp->font_size; - x = scp->xpixel/8 - scp->xoff - scp->xsize; - for (i = 0; i < scp->ysize*scp->font_size; ++i) { - if (scp->xoff > 0) - bzero_io((void *)(p + line_width*(y + i)), scp->xoff); - if (x > 0) - bzero_io((void *)(p + line_width*(y + i) - + scp->xoff + scp->xsize), x); - } - outw(GDCIDX, 0x0000); /* set/reset */ - outw(GDCIDX, 0x0001); /* set/reset enable */ -} - -static void -vga_egadraw(scr_stat *scp, int from, int count, int flip) -{ - vm_offset_t d; - vm_offset_t e; - u_char *f; - u_short bg; - u_short col1, col2; - int line_width; - int i, j; - int a; - u_char c; - - line_width = scp->sc->adp->va_line_width; - d = scp->sc->adp->va_window - + scp->xoff - + scp->yoff*scp->font_size*line_width - + (from%scp->xsize) - + scp->font_size*line_width*(from/scp->xsize); - - outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ - outw(GDCIDX, 0x0003); /* data rotate/function select */ - outw(GDCIDX, 0x0f01); /* set/reset enable */ - bg = -1; - if (from + count > scp->xsize*scp->ysize) - count = scp->xsize*scp->ysize - from; - for (i = from; count-- > 0; ++i) { - a = sc_vtb_geta(&scp->vtb, i); - if (flip) { - col1 = ((a & 0x7000) >> 4) | (a & 0x0800); - col2 = ((a & 0x8000) >> 4) | (a & 0x0700); - } else { - col1 = (a & 0x0f00); - col2 = (a & 0xf000) >> 4; - } - /* set background color in EGA/VGA latch */ - if (bg != col2) { - bg = col2; - outw(GDCIDX, bg | 0x00); /* set/reset */ - outw(GDCIDX, 0xff08); /* bit mask */ - writeb(d, 0); - c = readb(d); /* set bg color in the latch */ - } - /* foreground color */ - outw(GDCIDX, col1 | 0x00); /* set/reset */ - e = d; - f = &(scp->font[sc_vtb_getc(&scp->vtb, i)*scp->font_size]); - for (j = 0; j < scp->font_size; ++j, ++f) { - outw(GDCIDX, (*f << 8) | 0x08); /* bit mask */ - writeb(e, 0); - e += line_width; - } - ++d; - if ((i % scp->xsize) == scp->xsize - 1) - d += scp->xoff*2 - + (scp->font_size - 1)*line_width; - } - outw(GDCIDX, 0x0000); /* set/reset */ - outw(GDCIDX, 0x0001); /* set/reset enable */ - outw(GDCIDX, 0xff08); /* bit mask */ -} - -static void -vga_vgadraw(scr_stat *scp, int from, int count, int flip) -{ - vm_offset_t d; - vm_offset_t e; - u_char *f; - u_short bg; - u_short col1, col2; - int line_width; - int i, j; - int a; - u_char c; - - line_width = scp->sc->adp->va_line_width; - d = scp->sc->adp->va_window - + scp->xoff - + scp->yoff*scp->font_size*line_width - + (from%scp->xsize) - + scp->font_size*line_width*(from/scp->xsize); - - outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */ - outw(GDCIDX, 0x0003); /* data rotate/function select */ - outw(GDCIDX, 0x0f01); /* set/reset enable */ - outw(GDCIDX, 0xff08); /* bit mask */ - bg = -1; - if (from + count > scp->xsize*scp->ysize) - count = scp->xsize*scp->ysize - from; - for (i = from; count-- > 0; ++i) { - a = sc_vtb_geta(&scp->vtb, i); - if (flip) { - col1 = ((a & 0x7000) >> 4) | (a & 0x0800); - col2 = ((a & 0x8000) >> 4) | (a & 0x0700); - } else { - col1 = (a & 0x0f00); - col2 = (a & 0xf000) >> 4; - } - /* set background color in EGA/VGA latch */ - if (bg != col2) { - bg = col2; - outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ - outw(GDCIDX, bg | 0x00); /* set/reset */ - writeb(d, 0); - c = readb(d); /* set bg color in the latch */ - outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */ - } - /* foreground color */ - outw(GDCIDX, col1 | 0x00); /* set/reset */ - e = d; - f = &(scp->font[sc_vtb_getc(&scp->vtb, i)*scp->font_size]); - for (j = 0; j < scp->font_size; ++j, ++f) { - writeb(e, *f); - e += line_width; - } - ++d; - if ((i % scp->xsize) == scp->xsize - 1) - d += scp->xoff*2 - + (scp->font_size - 1)*line_width; - } - outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ - outw(GDCIDX, 0x0000); /* set/reset */ - outw(GDCIDX, 0x0001); /* set/reset enable */ -} - -static void -vga_pxlcursor_shape(scr_stat *scp, int base, int height, int blink) -{ - if (base < 0 || base >= scp->font_size) - return; - /* the caller may set height <= 0 in order to disable the cursor */ -#if 0 - scp->curs_attr.base = base; - scp->curs_attr.height = height; #endif -} static void -draw_pxlcursor(scr_stat *scp, int at, int on, int flip) +gfb_cursor(scr_stat *scp, int at, int blink, int on, int flip) { - vm_offset_t d; - u_char *f; - int line_width; - int height; - int col; - int a; - int i; - u_char c; - - line_width = scp->sc->adp->va_line_width; - d = scp->sc->adp->va_window - + scp->xoff - + scp->yoff*scp->font_size*line_width - + (at%scp->xsize) - + scp->font_size*line_width*(at/scp->xsize) - + (scp->font_size - scp->curs_attr.base - 1)*line_width; - - outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ - outw(GDCIDX, 0x0003); /* data rotate/function select */ - outw(GDCIDX, 0x0f01); /* set/reset enable */ - /* set background color in EGA/VGA latch */ - a = sc_vtb_geta(&scp->vtb, at); - if (flip) - col = (on) ? ((a & 0xf000) >> 4) : (a & 0x0f00); - else - col = (on) ? (a & 0x0f00) : ((a & 0xf000) >> 4); - outw(GDCIDX, col | 0x00); /* set/reset */ - outw(GDCIDX, 0xff08); /* bit mask */ - writeb(d, 0); - c = readb(d); /* set bg color in the latch */ - /* foreground color */ - if (flip) - col = (on) ? (a & 0x0f00) : ((a & 0xf000) >> 4); - else - col = (on) ? ((a & 0xf000) >> 4) : (a & 0x0f00); - outw(GDCIDX, col | 0x00); /* set/reset */ - f = &(scp->font[sc_vtb_getc(&scp->vtb, at)*scp->font_size - + scp->font_size - scp->curs_attr.base - 1]); - height = imin(scp->curs_attr.height, scp->font_size); - for (i = 0; i < height; ++i, --f) { - outw(GDCIDX, (*f << 8) | 0x08); /* bit mask */ - writeb(d, 0); - d -= line_width; - } - outw(GDCIDX, 0x0000); /* set/reset */ - outw(GDCIDX, 0x0001); /* set/reset enable */ - outw(GDCIDX, 0xff08); /* bit mask */ -} - -static int pxlblinkrate = 0; + video_adapter_t *adp; -static void -vga_pxlcursor(scr_stat *scp, int at, int blink, int on, int flip) -{ - if (scp->curs_attr.height <= 0) /* the text cursor is disabled */ + adp = scp->sc->adp; + if (scp->cursor_height <= 0) /* the text cursor is disabled */ return; if (on) { if (!blink) { scp->status |= VR_CURSOR_ON; - draw_pxlcursor(scp, at, on, flip); + (*vidsw[adp->va_index]->set_hw_cursor)(adp, + at%scp->xsize, at/scp->xsize); } else if (++pxlblinkrate & 4) { pxlblinkrate = 0; scp->status ^= VR_CURSOR_ON; - draw_pxlcursor(scp, at, - scp->status & VR_CURSOR_ON, - flip); + if(scp->status & VR_CURSOR_ON) + (*vidsw[adp->va_index]->set_hw_cursor)(adp, + at%scp->xsize, at/scp->xsize); + else + (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, + -1); } } else { if (scp->status & VR_CURSOR_ON) - draw_pxlcursor(scp, at, on, flip); + (*vidsw[adp->va_index]->set_hw_cursor)(adp, + at%scp->xsize, at/scp->xsize); scp->status &= ~VR_CURSOR_ON; } if (blink) @@ -707,7 +287,7 @@ vga_pxlcursor(scr_stat *scp, int at, int blink, int on, int flip) } static void -vga_pxlblink(scr_stat *scp, int at, int flip) +gfb_blink(scr_stat *scp, int at, int flip) { if (!(scp->status & VR_CURSOR_BLINK)) return; @@ -715,163 +295,35 @@ vga_pxlblink(scr_stat *scp, int at, int flip) return; pxlblinkrate = 0; scp->status ^= VR_CURSOR_ON; - draw_pxlcursor(scp, at, scp->status & VR_CURSOR_ON, flip); + gfb_cursor(scp, at, scp->status & VR_CURSOR_BLINK, + scp->status & VR_CURSOR_ON, flip); } #ifndef SC_NO_CUTPASTE -static void -draw_pxlmouse(scr_stat *scp, int x, int y) -{ - vm_offset_t p; - int line_width; - int xoff, yoff; - int ymax; - u_short m; - int i, j; - - line_width = scp->sc->adp->va_line_width; - xoff = (x - scp->xoff*8)%8; - yoff = y - (y/line_width)*line_width; - ymax = imin(y + 16, scp->ypixel); - - outw(GDCIDX, 0x0805); /* read mode 1, write mode 0 */ - outw(GDCIDX, 0x0001); /* set/reset enable */ - outw(GDCIDX, 0x0002); /* color compare */ - outw(GDCIDX, 0x0007); /* color don't care */ - outw(GDCIDX, 0xff08); /* bit mask */ - outw(GDCIDX, 0x0803); /* data rotate/function select (and) */ - p = scp->sc->adp->va_window + line_width*y + x/8; - if (x < scp->xpixel - 8) { - for (i = y, j = 0; i < ymax; ++i, ++j) { - m = ~(mouse_and_mask[j] >> xoff); -#ifdef __i386__ - *(u_char *)p &= m >> 8; - *(u_char *)(p + 1) &= m; -#elif defined(__alpha__) - writeb(p, readb(p) & (m >> 8)); - writeb(p + 1, readb(p + 1) & (m >> 8)); -#endif - p += line_width; - } - } else { - xoff += 8; - for (i = y, j = 0; i < ymax; ++i, ++j) { - m = ~(mouse_and_mask[j] >> xoff); -#ifdef __i386__ - *(u_char *)p &= m; -#elif defined(__alpha__) - writeb(p, readb(p) & (m >> 8)); -#endif - p += line_width; - } - } - outw(GDCIDX, 0x1003); /* data rotate/function select (or) */ - p = scp->sc->adp->va_window + line_width*y + x/8; - if (x < scp->xpixel - 8) { - for (i = y, j = 0; i < ymax; ++i, ++j) { - m = mouse_or_mask[j] >> xoff; -#ifdef __i386__ - *(u_char *)p &= m >> 8; - *(u_char *)(p + 1) &= m; -#elif defined(__alpha__) - writeb(p, readb(p) & (m >> 8)); - writeb(p + 1, readb(p + 1) & (m >> 8)); -#endif - p += line_width; - } - } else { - for (i = y, j = 0; i < ymax; ++i, ++j) { - m = mouse_or_mask[j] >> xoff; -#ifdef __i386__ - *(u_char *)p &= m; -#elif defined(__alpha__) - writeb(p, readb(p) & (m >> 8)); -#endif - p += line_width; - } - } - outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ - outw(GDCIDX, 0x0003); /* data rotate/function select */ -} - -static void -remove_pxlmouse(scr_stat *scp, int x, int y) -{ - vm_offset_t p; - int col, row; - int pos; - int line_width; - int ymax; - int i; - - /* erase the mouse cursor image */ - col = x/8 - scp->xoff; - row = y/scp->font_size - scp->yoff; - pos = row*scp->xsize + col; - i = (col < scp->xsize - 1) ? 2 : 1; - (*scp->rndr->draw)(scp, pos, i, FALSE); - if (row < scp->ysize - 1) - (*scp->rndr->draw)(scp, pos + scp->xsize, i, FALSE); - - /* paint border if necessary */ - line_width = scp->sc->adp->va_line_width; - outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ - outw(GDCIDX, 0x0003); /* data rotate/function select */ - outw(GDCIDX, 0x0f01); /* set/reset enable */ - outw(GDCIDX, 0xff08); /* bit mask */ - outw(GDCIDX, (scp->border << 8) | 0x00); /* set/reset */ - if (row == scp->ysize - 1) { - i = (scp->ysize + scp->yoff)*scp->font_size; - ymax = imin(i + scp->font_size, scp->ypixel); - p = scp->sc->adp->va_window + i*line_width + scp->xoff + col; - if (col < scp->xsize - 1) { - for (; i < ymax; ++i) { - writeb(p, 0); - writeb(p + 1, 0); - p += line_width; - } - } else { - for (; i < ymax; ++i) { - writeb(p, 0); - p += line_width; - } - } - } - if ((col == scp->xsize - 1) && (scp->xoff > 0)) { - i = (row + scp->yoff)*scp->font_size; - ymax = imin(i + scp->font_size*2, scp->ypixel); - p = scp->sc->adp->va_window + i*line_width - + scp->xoff + scp->xsize; - for (; i < ymax; ++i) { - writeb(p, 0); - p += line_width; - } - } - outw(GDCIDX, 0x0000); /* set/reset */ - outw(GDCIDX, 0x0001); /* set/reset enable */ -} - static void -vga_pxlmouse(scr_stat *scp, int x, int y, int on) +gfb_mouse(scr_stat *scp, int x, int y, int on) { - if (on) - draw_pxlmouse(scp, x, y); - else - remove_pxlmouse(scp, x, y); -} - -#endif /* SC_NO_CUTPASTE */ -#endif /* SC_PIXEL_MODE */ + int i, pos; -#ifndef SC_NO_MODE_CHANGE + if (on) { -/* graphics mode renderer */ + /* Display the mouse pointer image... */ + (*vidsw[scp->sc->adapter]->putm)(scp->sc->adp, x, y, + mouse_pointer, 0xffffffff, 16); + } else { -static void -vga_grborder(scr_stat *scp, int color) -{ - (*vidsw[scp->sc->adapter]->set_border)(scp->sc->adp, color); + /* + Erase the mouse cursor image by redrawing the text + underneath it... + */ + return; + pos = x*scp->xsize + y; + i = (y < scp->xsize - 1) ? 2 : 1; + (*scp->rndr->draw)(scp, pos, i, FALSE); + if (x < scp->ysize - 1) + (*scp->rndr->draw)(scp, pos + scp->xsize, i, FALSE); + } } -#endif +#endif /* SC_NO_CUTPASTE */ diff --git a/sys/dev/tga/tga_pci.c b/sys/dev/tga/tga_pci.c new file mode 100644 index 0000000..a1b2ccf --- /dev/null +++ b/sys/dev/tga/tga_pci.c @@ -0,0 +1,252 @@ +/* + * Copyright (c) 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + * + * Copyright (c) 2000 Andrew Miklic, Andrew Gallatin, and Thomas V. Crimi + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/conf.h> +#include <sys/proc.h> +#include <sys/fcntl.h> +#include <sys/malloc.h> +#include <sys/fbio.h> + +#include <vm/vm.h> +#include <vm/vm_param.h> +#include <vm/pmap.h> + +#include <machine/md_var.h> +#include <machine/pc/bios.h> +#include <machine/clock.h> +#include <machine/bus_memio.h> +#include <machine/bus.h> +#include <machine/pc/vesa.h> +#include <machine/resource.h> + +#include <sys/bus.h> +#include <sys/rman.h> + +#include <pci/pcireg.h> +#include <pci/pcivar.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/tga.h> +#include <dev/tga/tga_pci.h> +#include <dev/fb/gfb.h> +#include <dev/gfb/gfb_pci.h> + +#include "opt_fb.h" + +static int tga_probe(device_t); +static int tga_attach(device_t); +static void tga_intr(void *); + +static device_method_t tga_methods[] = { + DEVMETHOD(device_probe, tga_probe), + DEVMETHOD(device_attach, tga_attach), + DEVMETHOD(device_detach, pcigfb_detach), + { 0, 0 } +}; + +static driver_t tga_driver = { + "tga", + tga_methods, + sizeof(struct gfb_softc) +}; + +static devclass_t tga_devclass; + +DRIVER_MODULE(tga, pci, tga_driver, tga_devclass, 0, 0); + +static struct gfb_type tga_devs[] = { + { DEC_VENDORID, DEC_DEVICEID_TGA, + "DEC TGA (21030) 2D Graphics Accelerator" }, + { DEC_VENDORID, DEC_DEVICEID_TGA2, + "DEC TGA2 (21130) 3D Graphics Accelerator" }, + { 0, 0, NULL } +}; + +#ifdef FB_INSTALL_CDEV + +static struct cdevsw tga_cdevsw = { + /* open */ pcigfb_open, + /* close */ pcigfb_close, + /* read */ pcigfb_read, + /* write */ pcigfb_write, + /* ioctl */ pcigfb_ioctl, + /* poll */ nopoll, + /* mmap */ pcigfb_mmap, + /* strategy */ nostrategy, + /* name */ "tga", + /* maj */ -1, + /* dump */ nodump, + /* psize */ nopsize, + /* flags */ 0, + /* bmaj */ -1 +}; + +#endif /*FB_INSTALL_CDEV*/ + +static int +tga_probe(device_t dev) +{ + int error; + gfb_type_t t; + + t = tga_devs; + error = ENXIO; + while(t->name != NULL) { + if((pci_get_vendor(dev) == t->vendor_id) && + (pci_get_device(dev) == t->device_id)) { + device_set_desc(dev, t->name); + error = 0; + break; + } + t++; + } + return(error); +} + +static int +tga_attach(device_t dev) +{ + gfb_softc_t sc; + int unit, error, rid; + + error = 0; + unit = device_get_unit(dev); + sc = device_get_softc(dev); + bzero(sc, sizeof(struct gfb_softc)); + sc->driver_name = TGA_DRIVER_NAME; + switch(pci_get_device(dev)) { + case DEC_DEVICEID_TGA2: + sc->model = 1; + sc->type = KD_TGA2; + break; + case DEC_DEVICEID_TGA: + sc->model = 0; + sc->type = KD_TGA; + break; + default: + device_printf(dev, "Unrecognized TGA type\n"); + goto fail; + } + if((error = pcigfb_attach(dev))) { + goto fail; + } + sc->regs = sc->bhandle + TGA_MEM_CREGS; + error = bus_setup_intr(dev, sc->irq, INTR_TYPE_TTY, tga_intr, sc, + &sc->intrhand); + if(error) { + device_printf(dev, "couldn't set up irq\n"); + goto fail; + } + switch(sc->rev) { + case 0x1: + case 0x2: + case 0x3: + device_printf(dev, "TGA (21030) step %c\n", 'A' + sc->rev - 1); + break; + + case 0x20: + device_printf(dev, "TGA2 (21130) abstract software model\n"); + break; + + case 0x21: + case 0x22: + device_printf(dev, "TGA2 (21130) pass %d\n", sc->rev - 0x20); + break; + + default: + device_printf(dev, "Unknown stepping (0x%x)\n", sc->rev); + break; + } +#ifdef FB_INSTALL_CDEV + sc->cdevsw = &tga_cdevsw; + sc->devt = make_dev(sc->cdevsw, unit, 0, 0, 02660, "tga%x", unit); +#endif /*FB_INSTALL_CDEV*/ + goto done; +fail: + if(sc->intrhand != NULL) { + bus_teardown_intr(dev, sc->irq, sc->intrhand); + sc->intrhand = NULL; + } + if(sc->irq != NULL) { + rid = 0x0; + bus_release_resource(dev, SYS_RES_IRQ, rid, sc->irq); + sc->irq = NULL; + } + if(sc->res != NULL) { + rid = GFB_MEM_BASE_RID; + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->res); + sc->res = NULL; + } + error = ENXIO; +done: + return(error); +} + +static void +tga_intr(void *v) +{ + struct gfb_softc *sc = (struct gfb_softc *)v; + u_int32_t reg; + + reg = READ_GFB_REGISTER(sc->adp, TGA_REG_SISR); + if((reg & 0x00010001) != 0x00010001) { + + /* Odd. We never set any of the other interrupt enables. */ + if((reg & 0x1f) != 0) { + + /* Clear the mysterious pending interrupts. */ + WRITE_GFB_REGISTER(sc->adp, TGA_REG_SISR, (reg & 0x1f)); + GFB_REGISTER_WRITE_BARRIER(sc, TGA_REG_SISR, 1); + + /* This was our interrupt, even if we're puzzled as to + * why we got it. Don't make the interrupt handler + * think it was a stray. + */ + } + } + + /* Call the scheduled handler... */ + sc->gfbc->ramdac_intr(sc); + + /* + Clear interrupt field (this way, we will force a + memory error if we get an unexpected interrupt)... + */ + sc->gfbc->ramdac_intr = NULL; + + /* Disable the interrupt... */ + WRITE_GFB_REGISTER(sc->adp, TGA_REG_SISR, 0x00000001); + GFB_REGISTER_WRITE_BARRIER(sc, TGA_REG_SISR, 1); +} diff --git a/sys/dev/tga/tga_pci.h b/sys/dev/tga/tga_pci.h new file mode 100644 index 0000000..2699131 --- /dev/null +++ b/sys/dev/tga/tga_pci.h @@ -0,0 +1,299 @@ +/* + * Copyright (c) 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + * + * Copyright (c) 2000 Andrew Miklic + * + * $FreeBSD$ + */ + +#ifndef _PCI_TGA_H_ +#define _PCI_TGA_H_ + +/* + * Device-specific PCI register offsets and contents. + */ +#define TGA_PCIREG_PVRR 0x40 /* PCI Address Extension Register */ +#define TGA_PCIREG_PAER 0x44 /* PCI VGA Redirect Register */ + +/* + * TGA Memory Space offsets + */ +#define TGA_MEM_ALTROM 0x0000000 /* 0MB -- Alternate ROM space */ +#define TGA2_MEM_EXTDEV 0x0000000 /* 0MB -- External Device Access */ +#define TGA_MEM_CREGS 0x0100000 /* 1MB -- Core Registers */ +#define TGA_CREGS_SIZE 0x0100000 /* Core registers occupy 1MB */ +#define TGA_CREGS_ALIAS 0x0000400 /* Register copies every 1kB */ + +#define TGA2_MEM_CLOCK 0x0060000 /* TGA2 Clock access */ +#define TGA2_MEM_RAMDAC 0x0080000 /* TGA2 RAMDAC access */ + +/* + * TGA Core Space register numbers and contents. + */ +#define TGA_REG_GCBR0 0x000 /* Copy buffer 0 */ +#define TGA_REG_GCBR1 0x001 /* Copy buffer 1 */ +#define TGA_REG_GCBR2 0x002 /* Copy buffer 2 */ +#define TGA_REG_GCBR3 0x003 /* Copy buffer 3 */ +#define TGA_REG_GCBR4 0x004 /* Copy buffer 4 */ +#define TGA_REG_GCBR5 0x005 /* Copy buffer 5 */ +#define TGA_REG_GCBR6 0x006 /* Copy buffer 6 */ +#define TGA_REG_GCBR7 0x007 /* Copy buffer 7 */ + +#define TGA_REG_GFGR 0x008 /* Foreground */ +#define TGA_REG_GBGR 0x009 /* Background */ +#define TGA_REG_GPMR 0x00a /* Plane Mask */ +#define TGA_REG_GPXR_S 0x00b /* Pixel Mask (one-shot) */ +#define TGA_REG_GMOR 0x00c /* Mode */ +#define TGA_REG_GOPR 0x00d /* Raster Operation */ +#define TGA_REG_GPSR 0x00e /* Pixel Shift */ +#define TGA_REG_GADR 0x00f /* Address */ + +#define TGA_REG_GB1R 0x010 /* Bresenham 1 */ +#define TGA_REG_GB2R 0x011 /* Bresenham 2 */ +#define TGA_REG_GB3R 0x012 /* Bresenham 3 */ + +#define TGA_REG_GCTR 0x013 /* Continue */ +#define TGA_REG_GDER 0x014 /* Deep */ +#define TGA_REG_GREV 0x015 /* Start/Version on TGA, + * Revision on TGA2 */ +#define TGA_REG_GSMR 0x016 /* Stencil Mode */ +#define TGA_REG_GPXR_P 0x017 /* Pixel Mask (persistent) */ +#define TGA_REG_CCBR 0x018 /* Cursor Base Address */ +#define TGA_REG_VHCR 0x019 /* Horizontal Control */ +#define TGA_REG_VVCR 0x01a /* Vertical Control */ +#define TGA_REG_VVBR 0x01b /* Video Base Address */ +#define TGA_REG_VVVR 0x01c /* Video Valid */ +#define TGA_REG_CXYR 0x01d /* Cursor XY */ +#define TGA_REG_VSAR 0x01e /* Video Shift Address */ +#define TGA_REG_SISR 0x01f /* Interrupt Status */ +#define TGA_REG_GDAR 0x020 /* Data */ +#define TGA_REG_GRIR 0x021 /* Red Increment */ +#define TGA_REG_GGIR 0x022 /* Green Increment */ +#define TGA_REG_GBIR 0x023 /* Blue Increment */ +#define TGA_REG_GZIR_L 0x024 /* Z-increment Low */ +#define TGA_REG_GZIR_H 0x025 /* Z-Increment High */ +#define TGA_REG_GDBR 0x026 /* DMA Base Address */ +#define TGA_REG_GBWR 0x027 /* Bresenham Width */ +#define TGA_REG_GZVR_L 0x028 /* Z-value Low */ +#define TGA_REG_GZVR_H 0x029 /* Z-value High */ +#define TGA_REG_GZBR 0x02a /* Z-base address */ +/* GADR alias 0x02b */ +#define TGA_REG_GRVR 0x02c /* Red Value */ +#define TGA_REG_GGVR 0x02d /* Green Value */ +#define TGA_REG_GBVR 0x02e /* Blue Value */ +#define TGA_REG_GSWR 0x02f /* Span Width */ +#define TGA_REG_EPSR 0x030 /* Pallete and DAC Setup */ + +/* reserved 0x031 - 0x3f */ + +#define TGA_REG_GSNR0 0x040 /* Slope-no-go 0 */ +#define TGA_REG_GSNR1 0x041 /* Slope-no-go 1 */ +#define TGA_REG_GSNR2 0x042 /* Slope-no-go 2 */ +#define TGA_REG_GSNR3 0x043 /* Slope-no-go 3 */ +#define TGA_REG_GSNR4 0x044 /* Slope-no-go 4 */ +#define TGA_REG_GSNR5 0x045 /* Slope-no-go 5 */ +#define TGA_REG_GSNR6 0x046 /* Slope-no-go 6 */ +#define TGA_REG_GSNR7 0x047 /* Slope-no-go 7 */ + +#define TGA_REG_GSLR0 0x048 /* Slope 0 */ +#define TGA_REG_GSLR1 0x049 /* Slope 1 */ +#define TGA_REG_GSLR2 0x04a /* Slope 2 */ +#define TGA_REG_GSLR3 0x04b /* Slope 3 */ +#define TGA_REG_GSLR4 0x04c /* Slope 4 */ +#define TGA_REG_GSLR5 0x04d /* Slope 5 */ +#define TGA_REG_GSLR6 0x04e /* Slope 6 */ +#define TGA_REG_GSLR7 0x04f /* Slope 7 */ + +#define TGA_REG_GBCR0 0x050 /* Block Color 0 */ +#define TGA_REG_GBCR1 0x051 /* Block Color 1 */ +#define TGA_REG_GBCR2 0x052 /* Block Color 2 */ +#define TGA_REG_GBCR3 0x053 /* Block Color 3 */ +#define TGA_REG_GBCR4 0x054 /* Block Color 4 */ +#define TGA_REG_GBCR5 0x055 /* Block Color 5 */ +#define TGA_REG_GBCR6 0x056 /* Block Color 6 */ +#define TGA_REG_GBCR7 0x057 /* Block Color 7 */ + +#define TGA_REG_GCSR 0x058 /* Copy 64 Source */ +#define TGA_REG_GCDR 0x059 /* Copy 64 Destination */ +/* GC[SD]R aliases 0x05a - 0x05f */ + +/* reserved 0x060 - 0x077 */ + +#define TGA_REG_ERWR 0x078 /* EEPROM write */ + +/* reserved 0x079 */ + +#define TGA_REG_ECGR 0x07a /* Clock */ + +/* reserved 0x07b */ + +#define TGA_REG_EPDR 0x07c /* Pallete and DAC Data */ + +/* reserved 0x07d */ + +#define TGA_REG_SCSR 0x07e /* Command Status */ + +/* reserved 0x07f */ + +/* + * Deep register + */ +#define GDER_HSS 0x00010000 /* Horizontal sync select */ +#define GDER_SDAC 0x00004000 /* Slow DAC */ +#define GDER_RWE 0x00001000 /* ROM write enable */ +#define GDER_SAMS 0x00000400 /* Serial-access memory size */ +#define GDER_CS 0x00000200 /* Column size */ +#define GDER_BLOCK_MASK 0x000001e0 /* eight/four column segments */ +#define GDER_BLOCK_SHIFT 5 +#define GDER_ADDR_MASK 0x0000001c /* PCI address mask */ +#define GDER_ADDR_SHIFT 2 +#define GDER_ADDR_4MB 0x00000000 /* PCI mask <24:22> = 4MB */ +#define GDER_ADDR_8MB 0x00000001 /* PCI mask <24:23> = 8MB */ +#define GDER_ADDR_16MB 0x00000003 /* PCI mask bit 24 = 16MB */ +#define GDER_ADDR_32MB 0x00000007 /* No PCI masking = 32MB */ +#define GDER_DEEP 0x00000001 /* 32-bpp or 8 bpp frame buffer */ + +/* + * Graphics mode register + */ +#define GMOR_CE 0x00008000 /* Cap ends */ +#define GMOR_Z16 0x00004000 /* 16 or 24 bit Z valuesx */ +#define GMOR_GE 0x00002000 /* Win32 or X environment */ +#define GMOR_SBY_MASK 0x00001800 /* Source byte mask for 32-bpp FB */ +#define GMOR_SBY_0 0x00000000 /* Source byte 0 */ +#define GMOR_SBY_1 0x00000800 /* Source byte 1 */ +#define GMOR_SBY_2 0x00001000 /* Source byte 2 */ +#define GMOR_SBY_3 0x00001800 /* Source byte 3 */ +#define GMOR_SBM_MASK 0x00000700 /* Source bitmap format (32-bpp FB) */ +#define GMOR_SBM_8P 0x00000000 /* 8-bpp packed */ +#define GMOR_SBM_8U 0x00000100 /* 8-bpp unpacked */ +#define GMOR_SBM_12L 0x00000200 /* 12-bpp low */ +#define GMOR_SBM_12H 0x00000600 /* 12-bpp high */ +#define GMOR_SBM_24 0x00000300 /* 24-bpp */ +#define GMOR_MODE_MASK 0x0000007f /* Graphics mode mask */ +#define GMOR_MODE_SIMPLE 0x0000 /* Simple */ +#define GMOR_MODE_SIMPLEZ 0x0010 /* Simple Z */ +#define GMOR_MODE_OPQ_STPL 0x0001 /* Opaque Stipple */ +#define GMOR_MODE_OPQ_FILL 0x0021 /* Opaque Fill */ +#define GMOR_MODE_TRN_STPL 0x0005 /* Transparent Stipple */ +#define GMOR_MODE_TRN_FILL 0x0025 /* Transparent Fill */ +#define GMOR_MODE_BLK_STPL 0x000d /* Block Stipple */ +#define GMOR_MODE_BLK_FILL 0x002d /* Block Fill */ +#define GMOR_MODE_OPQ_LINE 0x0002 /* Opaque Line */ +#define GMOR_MODE_TRN_LINE 0x0006 /* Transparent Line */ +#define GMOR_MODE_CITNDL 0x000e /* Color-interpolated transparent */ + /* non-dithered line */ +#define GMOR_MODE_CITDL 0x002e /* Color-intrp. trans. dithered line */ +#define GMOR_MODE_SITL 0x004e /* Sequential-intrp. transp line */ +#define GMOR_MODE_ZOPQ_LINE 0x0012 /* Z buffered Opaque Line */ +#define GMOR_MODE_ZTRN_LINE 0x0016 /* Z buffered Trans Line */ +#define GMOR_MODE_ZOCITNDL 0x001a /* Z buffered Opaque CITND line */ +#define GMOR_MODE_ZOCITDL 0x003a /* Z buffered Opaque CITD line */ +#define GMOR_MODE_ZOSITL 0x005a /* Z buffered Opaque SIT line */ +#define GMOR_MODE_ZTCITNDL 0x001e /* Z buffered transparent CITND line */ +#define GMOR_MODE_ZTCITDL 0x003e /* Z buffered transparent CITD line */ +#define GMOR_MODE_ZTSITL 0x005e /* Z buffered transparent SIT line */ +#define GMOR_MODE_COPY 0x0007 /* Copy */ +#define GMOR_MODE_DRDND 0x0017 /* DMA-read copy, non-dithered */ +#define GMOR_MODE_DRDD 0x0037 /* DMA-read copy, dithered */ +#define GMOR_MODE_DWCOPY 0x001f /* DMA-write copy */ + +/* + * Video Horizontal Control Register + */ +#define VHCR_ODD 0x80000000 /* Enable 4-pixel line skew */ +#define VHCR_HSP 0x40000000 /* Horizontal sync polarity */ +#define VHCR_BPORCH_MASK 0xfe00000 /* Back porch pixels / 4 */ +#define VHCR_BPORCH_SHIFT 21 +#define VHCR_HSYNC_MASK 0x001fc000 /* Hsync width / 4 */ +#define VHCR_HSYNC_SHIFT 14 +#define VHCR_FPORCH_MASK 0x3e00 /* Front porch pixels / 4 */ +#define VHCR_FPORCH_SHIFT 9 +#define VHCR_ACTIVE_MASK 0x01ff /* Active lines */ + +#define VHCR_REG2ACTIVE(reg) ((((reg) >> 19) & 0x0600) | ((reg) & 0x01ff)) +#define VHCR_ACTIVE2REG(val) ((((val) & 0x0600) << 19) | ((val) & 0x01ff)) + +/* + * Video Vertical Control Register + */ +#define VVCR_SE 0x80000000 /* Stereo Enable */ +#define VVCR_VSP 0x40000000 /* Vertical sync polarity */ +#define VVCR_BPORCH_MASK 0xfc00000 /* Back porch in lines */ +#define VVCR_BPORCH_SHIFT 22 +#define VVCR_VSYNC_MASK 0x003f0000 /* Vsync width in lines */ +#define VVCR_VSYNC_SHIFT 16 +#define VVCR_FPORCH_MASK 0xf800 /* Front porch in lines */ +#define VVCR_FPORCH_SHIFT 11 +#define VVCR_ACTIVE_MASK 0x07ff /* Active lines */ + +/* + * Video Valid Register + */ +#define VVR_VIDEOVALID 0x00000001 /* 0 VGA, 1 TGA2 (TGA2 only) */ +#define VVR_BLANK 0x00000002 /* 0 active, 1 blank */ +#define VVR_CURSOR 0x00000004 /* 0 disable, 1 enable (TGA2 R/O) */ +#define VVR_INTERLACE 0x00000008 /* 0 N/Int, 1 Int. (TGA2 R/O) */ +#define VVR_DPMS_MASK 0x00000030 /* See "DMPS mask" below */ +#define VVR_DPMS_SHIFT 4 +#define VVR_DDC 0x00000040 /* DDC-in pin value (R/O) */ +#define VVR_TILED 0x00000400 /* 0 linear, 1 tiled (not on TGA2) */ +#define VVR_LDDLY_MASK 0x01ff0000 /* load delay in quad pixel clock ticks + (not on TGA2) */ +#define VVR_LDDLY_SHIFT 16 + +/* TGA PCI register values */ + +#define DEC_VENDORID 0x1011 +#define DEC_DEVICEID_TGA 0x0004 +#define DEC_DEVICEID_TGA2 0x000D /* This is 0x000C in the documentation, + but probing yields 0x000D... */ +#define TGA_TYPE_T8_01 0 /* 8bpp, 1MB */ +#define TGA_TYPE_T8_02 1 /* 8bpp, 2MB */ +#define TGA_TYPE_T8_22 2 /* 8bpp, 4MB */ +#define TGA_TYPE_T8_44 3 /* 8bpp, 8MB */ +#define TGA_TYPE_T32_04 4 /* 32bpp, 4MB */ +#define TGA_TYPE_T32_08 5 /* 32bpp, 8MB */ +#define TGA_TYPE_T32_88 6 /* 32bpp, 16MB */ +#define TGA2_TYPE_3D30 7 /* 8bpp, 8MB */ +#define TGA2_TYPE_4D20 8 /* 32bpp, 16MB */ +#define TGA_TYPE_UNKNOWN 9 /* unknown */ + +/* Possible video modes for TGA2... */ + +#define TGA2_VGA_MODE 0 +#define TGA2_2DA_MODE 1 + +/* TGA register access macros */ + +#define TGA_REG_SPACE_OFFSET 0x100000 + +#define BASIC_READ_TGA_REGISTER(adp, reg) \ + *(u_int32_t *)((adp)->va_mem_base + \ + (vm_offset_t)TGA_REG_SPACE_OFFSET + \ + (((vm_offset_t)(reg) << 2L))) + +#endif /* _PCI_TGA_H_ */ |