Subject: A2410 driver and text console, shar with beta test code (36 kBytes)
To: None <amiga-dev@netbsd.org>
From: Ignatios Souvatzis <is@beverly.rhein.de>
List: amiga-dev
Date: 06/21/1995 14:29:09
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	uldiffs
#	dev/grf_ulreg.h
#	dev/grf_ul.c
#	dev/ite_ul.c
#	dev/grf_ultmscode.h
#
echo x - uldiffs
sed 's/^X//' >uldiffs << 'END-of-uldiffs'
X+++ dev/zbus.c	Wed Jun 21 12:07:21 1995
X@@ -137,7 +137,8 @@
X 	{2193,	2, 0},	/* Spectrum mem */
X 	{2193,	1, 0},	/* Spectrum regs */
X 	{2195,	5, 0},	/* Piccolo mem */
X-	{2195,	6, 0}	/* Piccolo regs */
X+	{2195,	6, 0},	/* Piccolo regs */
X+	{1030,	0, 0}	/* Ulwl board */
X };
X static int npreconfent = sizeof(preconftab) / sizeof(struct preconfdata);
X 
X+++ conf/files.amiga	Tue Jun 13 09:49:00 1995
X@@ -80,6 +80,11 @@
X file	arch/amiga/dev/grf_rh.c		grfrh needs-flag
X file	arch/amiga/dev/ite_rh.c		grfrh ite
X   
X+# University of Lowell A2410 grf
X+device	grful at zbus: grfbus
X+file	arch/amiga/dev/grf_ul.c		grful needs-flag
X+file	arch/amiga/dev/ite_ul.c		grful ite kfont_8x11
X+  
X # handle gvp's odd autoconf info..
X device	gvpbus at zbus {}
X file	arch/amiga/dev/gvpbus.c		gvpbus
X+++ dev/grfvar.h	Tue Jun 13 09:34:34 1995
X@@ -105,5 +105,6 @@
X 	GRF_CC_UNIT,
X 	GRF_RETINAII_UNIT,
X 	GRF_RETINAIII_UNIT,
X-	GRF_CL5426_UNIT
X+	GRF_CL5426_UNIT,
X+	GRF_ULOWELL_UNIT
X };
END-of-uldiffs
echo x - dev/grf_ulreg.h
sed 's/^X//' >dev/grf_ulreg.h << 'END-of-dev/grf_ulreg.h'
X/*
X * Registers etc. for the University of Lowell graphics board.
X */
X
Xstruct gspregs {
X	/*
X	 * alas, they didn't invert the A1 bit, so be have to write the 
X	 * address pointer in two parts
X	 */
X	volatile u_short hstadrl;
X	volatile u_short hstadrh;
X	volatile u_short data;
X	volatile u_short ctrl;
X};
X
X/* Bits in ctrl */
X#define HLT	0x8000
X#define CF	0x4000
X#define LBL	0x2000
X#define INCR	0x1000
X#define INCW	0x0800
X#define NMIM	0x0200
X#define NMI	0x0100
X
X#define INTOUT	0x0080
X#define MSGOUT	0x0070
X#define INTIN	0x0008
X#define	MSGIN	0x0007
X
X/* address macros */
X
X#define GSPSETHADRS(gsp,adrs) (gsp)->hstadrh = (adrs)>>16; (gsp)->hstadrl = (adrs)
X#define GSPGETHADRS(gsp) ((gsp)->hstadrh << 16 | (gsp)->hstadrl)
X
X/* Standard addresses in GSP memory */
X
X#define PUT_PTR_ADRS    0xFFA20000	/* put pointer in ring buffer */
X#define PUT_HI_PTR_ADRS 0xFFA20010	/* put pointer high word */
X#define GET_PTR_ADRS    0xFFA20020	/* get pointer (low word) */
X#define GSP_MODE_ADRS   0xFFA20040	/* GSP mode word */
X
X/* Bits in GSP mode word */
X#define GMODE_HOLD      1               /* hold screen */
X#define GMODE_FLUSH     2               /* flush GSP input queue */
X#define GMODE_ALTSCRN   4               /* use alternate screen */
X#define GMODE_DISPCTRL  8               /* display control chars */
X
X/* command words */
X#define GCMD_CMD_MSK	0x000F
X#define GCMD_PAR_MSK	0xFFF0
X
X#define GCMD_NOP	0
X#define GCMD_CHAR	1	/* char, fg, bg, x, y */
X#define GCMD_FILL	2	/* fg, x, y, w, h, ppop */
X#define GCMD_PIXBLT	3	/* x, y, w, h, dx, dy */
X#define GCMD_FNTMIR	4	/* */
X
Xstruct MonDef {
X
X	/* first the general monitor characteristics */
X
X	unsigned short TFLG;	/* for C0000080 */
X	unsigned short HWFLG;	
X#define ULF_OSC 1
X
X	unsigned short MW;	/* screen width in pixels */
X				/* has to be at least a multiple of 16, */
X	                        /* has to be a multiple of 64 */
X	                        /* if you want to use some great tricks */
X	                        /* to speed up the vertical scrolling */
X	unsigned short MH;	/* screen height in pixels */
X
X	unsigned short HSE;	/* on the A2410, in units of 16 pixels */
X	unsigned short HBE;
X	unsigned short HBS;
X	unsigned short HSS;
X
X	unsigned short VSE;	/* in units of lines */
X	unsigned short VBE;
X	unsigned short VBS;
X	unsigned short VSS;
X
X	unsigned short DEP;	/* Color-depth */
X	unsigned char * const PAL;
X				/* points to 16*3 byte RGB-palette data */
X	                    	/* use LoadPalette() to set colors 0..255 */
X	                    	/* in 256-color-gfx mode */
X
X};
X
Xstruct grf_ul_softc {
X	struct grf_softc	gus_sc;
X	struct isr		gus_isr;
X};
X
X#ifdef _KERNEL
Xvoid gsp_write(struct gspregs *gsp, u_short *data, size_t size);
X#endif
X
END-of-dev/grf_ulreg.h
echo x - dev/grf_ul.c
sed 's/^X//' >dev/grf_ul.c << 'END-of-dev/grf_ul.c'
X/*	$Id: grf_ul.c,v 1.1.2.4 1995/06/21 10:56:45 is Exp is $	*/
X
X/*
X * Copyright (c) 1995 Ignatios Souvatzis
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X *    notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X *    notice, this list of conditions and the following disclaimer in the
X *    documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X *    must display the following acknowledgement:
X *      This product includes software developed by Lutz Vieweg.
X * 4. The name of the author may not be used to endorse or promote products
X *    derived from this software without specific prior written permission
X *
X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
X * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
X * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
X * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
X * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
X * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
X * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
X */
X#include "grful.h"
X#if NGRFUL > 0
X
X/* Graphics routines for the University of Lowell A2410 board, 
X   using the TMS34010 processor. */
X
X#include <sys/param.h>
X#include <sys/proc.h>
X#include <sys/errno.h>
X#include <sys/ioctl.h>
X#include <sys/device.h>
X#include <sys/tty.h>
X#include <sys/malloc.h>
X#include <sys/syslog.h>
X
X#include <machine/cpu.h>
X
X#include <amiga/amiga/device.h>
X#include <amiga/amiga/isr.h>
X#include <amiga/dev/zbusvar.h>
X#include <amiga/dev/grfioctl.h>
X#include <amiga/dev/grfvar.h>
X#include <amiga/dev/grf_ulreg.h>
X#include <amiga/dev/grf_ultmscode.h>
X
Xint ul_ioctl __P((struct grf_softc *gp, u_long, void *));
X
X/*
X * marked true early so that ulowell_cnprobe() can tell if we are alive. 
X */
Xint ulowell_inited;
X
X/* standard-palette definition */
Xconst u_char ul_std_palette[] = {
X	0,	0,	0,
X	128,	0,	0,
X	0,	128,	0,
X	128,	128,	0,
X	0,	0,	128,
X	128,	0,	128,
X	0,	128,	128,
X	128,	128,	128,
X	0,	0,	0,
X	255,	0,	0,
X	0,	255,	0,
X	255,	255,	0,
X	0,	0,	255,
X	255,	0,	255,
X	0,	255,	255,
X	255,	255,	255
X};
X
Xstruct MonDef monitor_defs[] = {
X
X   /* GFX modes */
X
X/* horizontal 49kHz */
X
X   { 0xf020, 0x02, 1024, 768,  12, 18, 82, 86, 2, 26, 794, 797,
X          8, ul_std_palette}, /* 8bit gfx */
X
X   { 0xf020, 0x02, 1024, 768,  12, 18, 82, 86, 2, 26, 794, 797,
X          1, ul_std_palette}, /* 1 overlay plane, not impl */
X
X   { 0xf020, 0x02, 864, 648,  3, 7, 61, 65, 4, 19, 667, 677,
X          8, ul_std_palette}, /* 8bit gfx */
X
X   { 0xf020, 0x02, 864, 648,  3, 7, 61, 65, 4, 19, 667, 677,
X          1, ul_std_palette}, /* 8bit gfx */
X
X   { 0xf020, 0x02, 800, 600,  3, 7, 57, 61, 4, 19, 619, 629,
X          8, ul_std_palette}, /* 8bit gfx */
X
X   { 0xf020, 0x02, 800, 600,  3, 7, 57, 61, 4, 19, 619, 629,
X          8, ul_std_palette}, /* 8bit gfx */
X
X};
X
Xstatic const char *monitor_descr[] = {
X
X  "GFX (1024x768) 49kHz/61Hz", 	/* with 67.88 MHz quartz */
X  "OVL (1024x768) 49kHz/61Hz",
X  "GFX (864x648) 48kHz/70Hz",	/* with 50 MHz quartz */
X  "OVL (864x648) 48kHz/70Hz",
X  "GFX (800x600) 36.9kHz/58Hz",	/* with 36 MHz quartz */
X  "OVL (800x600) 36.9kHz/58Hz",
X};
X
Xint ulowell_mon_max = sizeof (monitor_defs)/sizeof (monitor_defs[0]);
X
X/* patchable */
Xint ulowell_default_mon = 1;
Xint ulowell_default_gfx = 0;
X    
Xstatic struct MonDef *current_mon;
X
X/*
X * We dont use ints at the moment, but will need this later to avoid
X * busy_waiting in gsp_write, and we use it for spurious int warnings.
X */
X
Xstatic int 
Xulisr(gp)
Xstruct grf_softc *gp;
X{
X	struct gspregs *ba;
X	u_int16_t	thebits;
X
X	if (gp == NULL)
X		return 0;
X
X	ba = (struct gspregs *)gp->g_regkva;
X
X	if (ba == NULL)
X		return 0;
X
X	thebits = ba->ctrl;
X	if (thebits & INTOUT) {
X		log(LOG_INFO, "grf4: got interrupt, ctrl=0x%4x\n", thebits);
X		/* clear int */
X		ba->ctrl = thebits & ~INTOUT;
X		return 1;
X	} 
X	return 0;
X}
X
X/*
X * used to query the ulowell board to see if its alive.
X * for the moment, a NOP.
X */
Xint
Xulowell_alive(mdp)
X	struct MonDef *mdp;
X{
X	return 1;
X}
X
Xstatic int
Xul_load_mon(gp, md)
X	struct grf_softc *gp;
X	struct MonDef *md;
X{
X	struct grfinfo *gi;
X	struct gspregs *ba;
X	u_short *sp;
X	u_char *cp;
X	int i,j;
X
X#ifdef UL_DEBUG
X	printf("ul_load_mon called: 0x%x 0x%x\n", gp, md);
X#endif
X
X	gi = &gp->g_display;
X	ba = (struct gspregs *)gp->g_regkva;
X
X	gp->g_data	= 
X	
X	gi->gd_regaddr	= ztwopa((caddr_t)ba);
X	gi->gd_regsize	= sizeof(struct gspregs);
X	gi->gd_fbaddr	= NULL;
X	gi->gd_fbsize	= 0;
X/*XXX tobedone */
X	gi->gd_fbwidth	= md->MW;
X	gi->gd_fbheight	= md->MH;
X	gi->gd_colors	= 1 << md->DEP;
X	gi->gd_dyn.gdi_fbx	= 0;
X	gi->gd_dyn.gdi_fby	= 0;
X	gi->gd_dyn.gdi_dwidth	= md->MW;
X	gi->gd_dyn.gdi_dheight	= md->MH;
X	gi->gd_dyn.gdi_dx	= 0;
X	gi->gd_dyn.gdi_dy	= 0;
X
X	ba->ctrl = ba->ctrl & ~INCR | (LBL|INCW);
X	ba->hstadrh = 0xC000;
X	ba->hstadrl = 0x0080;
X	ba->data = 0x0;		/* disable screen refresh and video output */
X	ba->data = 0xFFFC;	/* screen refresh base address */
X	ba->data = 0xFFFF;	/* no display int possible */
X	ba->data = 0x000C;	/* CAS before RAS refresh each 64 local clks */
X
X	ba->hstadrl = 0x0000;
X	ba->data = md->HSE;
X	ba->data = md->HBE;
X	ba->data = md->HBS;
X	ba->data = md->HSS;
X	ba->data = md->VSE;
X	ba->data = md->VBE;
X	ba->data = md->VBS;
X	ba->data = md->VSS;
X
X	ba->hstadrh = 0xFE90;
X	ba->hstadrl = 0x0000;
X	ba->data = ba->data & 0xFC | md->HWFLG;
X
X	ba->ctrl |= LBL;
X	ba->hstadrh = 0xC000;
X	ba->hstadrl = 0x0080;
X	ba->data = md->TFLG;
X
X	/* XXX load palette */
X
X	ba->hstadrh = 0xfe80;
X	ba->hstadrl = 0x0000;
X	ba->ctrl |= INCW;
X	ba->data = 0;
X	ba->ctrl &= ~INCW;
X
X	for (i=0; i<16*3; ++i)
X		ba->data = (u_short)md->PAL[i];
X
X	ba->ctrl = ba->ctrl & ~INCW | LBL;
X	ba->hstadrl = 0;
X	ba->data = 4;
X	ba->hstadrl = 0x20;
X	ba->data = 0xFF;
X
X	ba->hstadrl = 0;
X	ba->data = 5;
X	ba->hstadrl = 0x20;
X	ba->data = 0;
X
X	ba->hstadrl = 0;
X	ba->data = 6;
X	ba->hstadrl = 0x20;
X	ba->data = 0x40;
X
X	ba->hstadrl = 0;
X	ba->data = 7;
X	ba->hstadrl = 0x20;
X	ba->data = 0;
X	
X	/* clear color framebuf ... should be done by tms now.*/
X	ba->ctrl |= INCW;
X
X	/* clear overlay planes */
X	ba->hstadrh = 0xff80;
X	ba->hstadrl = 0x0000;
X	for (i=0xff80000; i< 0xffa0000; ++i) {
X		ba->data = 0;
X	}
X
X	/* download tms code */
X
X	ba->ctrl = LBL | INCW | NMI | NMIM | HLT | CF;
X
X	printf("\ndownloading TMS code");
X	for (i=0; i<NTMSBLOCKS; ++i) {
X		printf(".");
X		ba->hstadrh = tmscode[i].startaddr >> 16;
X		ba->hstadrl = tmscode[i].startaddr;
X		for (j=0; j<tmscode[i].size; ++j) {
X			ba->data = tmscode[i].datptr[j];
X		}
X	}
X	ba->ctrl &= ~CF;
X
X	/* I guess this should be in the yet unimplemented mode select ioctl */
X
X	ba->hstadrh = 0xFFA2;
X	ba->hstadrl = 0x0140;
X	ba->data = md->MW;
X	ba->data = md->MH;
X	ba->data = 0;				   /* LSW of screen origin */
X	ba->data = md->DEP == 8 ? 0xFE00 : 0xFF80; /* MSW of screen origin */
X	ba->data = md->DEP * md->MW;
X	ba->data = md->DEP;
X
X	/* font info was uploaded in ite_ul.c(ite_ulinit). */
X
X#ifdef TMSSTART
X	printf("starting TMS at 0x%08x",TMSSTART);
X	ba->ctrl = LBL | INCW | NMI | NMIM | HLT | CF;
X
X	ba->hstadrh = 0xFFFF;
X	ba->hstadrl = 0xFFE0;		/* RESET vector */
X	ba->data = TMSSTART;
X	ba->data = TMSSTART >> 16;
X	ba->hstadrh = 0xFFFF;
X	ba->hstadrl = 0xFEE0;		/* NMI vector */
X	ba->data = TMSSTART;
X	ba->data = TMSSTART >> 16;
X	ba->ctrl |= HLT|NMI|NMIM;
X	ba->ctrl &= ~HLT;
X#endif
X
X	return(1);
X}
X
Xint ul_mode __P((struct grf_softc *, int, void *, int , int));
X
Xvoid grfulattach __P((struct device *, struct device *, void *));
Xint grfulprint __P((void *, char *));
Xint grfulmatch __P((struct device *, struct cfdata *, void *));
X 
Xstruct cfdriver grfulcd = {
X	NULL, "grful", (cfmatch_t)grfulmatch, grfulattach, 
X	DV_DULL, sizeof(struct grf_ul_softc), NULL, 0 };
X
X/*
X * only used in console init
X */
Xstatic struct cfdata *cfdata;
X
X/*
X * we make sure to only init things once.  this is somewhat
X * tricky regarding the console.
X */
Xint 
Xgrfulmatch(pdp, cfp, auxp)
X	struct device *pdp;
X	struct cfdata *cfp;
X	void *auxp;
X{
X#ifdef ULOWELLCONSOLE
X	static int ulconunit = -1;
X#endif
X	struct zbus_args *zap;
X
X	zap = auxp;
X
X	/*
X	 * allow only one ulowell console
X	 */
X        if (amiga_realconfig == 0)
X#ifdef ULOWELLCONSOLE
X		if (ulconunit != -1)
X#endif
X			return(0);
X
X	if (zap->manid != 1030 || zap->prodid != 0)
X		return(0);
X
X#ifdef ULOWELLCONSOLE
X	if (amiga_realconfig == 0 || ulconunit != cfp->cf_unit) {
X#endif
X		if ((unsigned)ulowell_default_mon >= ulowell_mon_max ||
X		    monitor_defs[ulowell_default_mon].DEP == 8)
X			ulowell_default_mon = 0;
X
X		current_mon = monitor_defs + ulowell_default_mon;
X		if (ulowell_alive(current_mon) == 0)
X			return(0);
X#ifdef ULOWELLCONSOLE 
X		if (amiga_realconfig == 0) {
X			ulconunit = cfp->cf_unit;
X			cfdata = cfp;
X		} 
X	}
X#endif
X	return(1);
X}
X
X/* 
X * attach to the grfbus (zbus)
X */
Xvoid
Xgrfulattach(pdp, dp, auxp)
X	struct device *pdp, *dp;
X	void *auxp;
X{
X	static struct grf_ul_softc congrf;
X	static int coninited;
X	struct zbus_args *zap;
X	struct grf_softc *gp;
X	struct grf_ul_softc *gup;
X
X	zap = auxp;
X	
X	if (dp == NULL) 
X		gp = &congrf.gus_sc;
X	else
X		gp = (struct grf_softc *)dp;
X
X	gup = (struct grf_ul_softc *)gp;
X
X	if (dp != NULL && congrf.gus_sc.g_regkva != 0) {
X		/*
X		 * we inited earlier just copy the info
X		 * take care not to copy the device struct though.
X		 */
X		bcopy(&congrf.gus_sc.g_display, &gp->g_display, 
X		    (char *)&gp[1] - (char *)&gp->g_display);
X		gup->gus_isr.isr_ipl = 2;
X		gup->gus_isr.isr_intr = ulisr;
X		gup->gus_isr.isr_arg = (void *)gp;
X		/* 
X		 * To make sure ints are always catched, first add new isr
X		 * then remove old:
X		 */
X		add_isr(&gup->gus_isr);
X		remove_isr(&congrf.gus_isr);
X	} else {
X		gp->g_regkva = (volatile caddr_t)zap->va;
X		gp->g_fbkva = NULL;
X		gp->g_unit = GRF_ULOWELL_UNIT;
X		gp->g_flags = GF_ALIVE;
X		gp->g_mode = ul_mode;
X		gp->g_conpri = grful_cnprobe();
X		gp->g_data = NULL;
X		gup->gus_isr.isr_ipl = 2;
X		gup->gus_isr.isr_intr = ulisr;
X		gup->gus_isr.isr_arg = (void *)gp;
X		add_isr(&gup->gus_isr);
X
X		grful_iteinit(gp);
X		(void)ul_load_mon(gp, current_mon);
X
X	}
X	if (dp != NULL)
X		printf("\n");
X	/*
X	 * attach grf
X	 */
X	amiga_config_found(cfdata, &gp->g_device, gp, grfulprint);
X}
X
Xint
Xgrfulprint(auxp, pnp)
X	void *auxp;
X	char *pnp;
X{
X	if (pnp)
X		printf("grf%d at %s", ((struct grf_softc *)auxp)->g_unit,
X			pnp);
X	return(UNCONF);
X}
X
Xstatic int 
Xul_getvmode (gp, vm)
X     struct grf_softc *gp;
X     struct grfvideo_mode *vm;
X{
X  struct MonDef *md;
X/*** XXX dobedone below this ***/
X  if (vm->mode_num && vm->mode_num > ulowell_mon_max)
X    return EINVAL;
X
X  if (! vm->mode_num)
X    vm->mode_num = current_mon - monitor_defs;
X
X  md = monitor_defs + vm->mode_num;
X  strncpy (vm->mode_descr, monitor_descr + vm->mode_num, 
X	   sizeof (vm->mode_descr));
X  vm->pixel_clock  = 6666666;	/* should tell tms to measure it */
X  vm->disp_width   = md->MW;
X  vm->disp_height  = md->MH;
X  vm->depth        = md->DEP;
X  vm->hblank_start = md->HBS;
X  vm->hblank_stop  = md->HBE;
X  vm->hsync_start  = md->HSS;
X  vm->hsync_stop   = md->HSE;
X  vm->htotal       = md->HSS;
X  vm->vblank_start = md->VBS;
X  vm->vblank_stop  = md->VBE;
X  vm->vsync_start  = md->VSS;
X  vm->vsync_stop   = md->VSE;
X  vm->vtotal       = md->VSS;
X
X  return 0;
X}
X
X
Xstatic int 
Xul_setvmode (gp, mode, txtonly)
X     struct grf_softc *gp;
X     unsigned mode;
X     int txtonly;
X{
X  struct MonDef *md;
X  int error;
X
X  if (!mode || mode > ulowell_mon_max)
X    return EINVAL;
X
X  /*
X   * if (txtonly && monitor_defs[mode].DEP == 8)
X   *	return EINVAL;
X   */
X
X  current_mon = monitor_defs + mode;
X
X  error = ul_load_mon (gp, current_mon) ? 0 : EINVAL;
X
X  return error;
X}
X
X
X/*
X * Change the mode of the display.
X * Return a UNIX error number or 0 for success.
X */
Xint
Xul_mode(gp, cmd, arg, a2, a3)
X	struct grf_softc *gp;
X	int cmd;
X	void *arg;
X	int a2, a3;
X{
X  /* implement these later... */
X
X  switch (cmd)
X    {
X    case GM_GRFON:
X      ul_setvmode (gp, ulowell_default_gfx, 0);
X      return 0;
X      
X    case GM_GRFOFF:
X      ul_setvmode (gp, ulowell_default_mon, 1);
X      return 0;
X      
X    case GM_GRFCONFIG:
X      return 0;
X
X    case GM_GRFGETVMODE:
X      return ul_getvmode (gp, (struct grfvideo_mode *) arg);
X
X    case GM_GRFSETVMODE:
X      return ul_setvmode (gp, *(unsigned *) arg, 1);
X
X    case GM_GRFGETNUMVM:
X      *(int *)arg = ulowell_mon_max;
X      return 0;
X
X    case GM_GRFIOCTL:
X      return ul_ioctl (gp, arg, a2);
X
X    default:
X      break;
X    }
X    
X  return EINVAL;
X}
X
Xint
Xul_ioctl (gp, cmd, data)
X	register struct grf_softc *gp;
X	u_long cmd;
X	void *data;
X{
X  switch (cmd)
X    {
X
X#if 0
X	/*** we have no hardware sprites. ***/
X    case GRFIOCGSPRITEPOS:
X      return ul_getspritepos (gp, (struct grf_position *) data);
X
X    case GRFIOCSSPRITEPOS:
X      return ul_setspritepos (gp, (struct grf_position *) data);
X
X    case GRFIOCSSPRITEINF:
X      return ul_setspriteinfo (gp, (struct grf_spriteinfo *) data);
X
X    case GRFIOCGSPRITEINF:
X      return ul_getspriteinfo (gp, (struct grf_spriteinfo *) data);
X
X    case GRFIOCGSPRITEMAX:
X      return ul_getspritemax (gp, (struct grf_position *) data);
X
X#endif
X
X    case GRFIOCGETCMAP:
X      return ul_getcmap (gp, (struct grf_colormap *) data);
X
X    case GRFIOCPUTCMAP:
X      return ul_putcmap (gp, (struct grf_colormap *) data);
X
X    case GRFIOCBITBLT:
X      return ul_bitblt (gp, (struct grf_bitblt *) data);
X    }
X
X  return EINVAL;
X}     
X
Xint
Xul_getcmap (gfp, cmap)
X     struct grf_softc *gfp;
X     struct grf_colormap *cmap;
X{
X  struct gspregs *ba;
X  u_char red[256], green[256], blue[256], *rp, *gp, *bp;
X  short x;
X  int error;
X
X  if (cmap->count == 0 || cmap->index >= 256)
X    return 0;
X
X  if (cmap->index + cmap->count > 256)
X    cmap->count = 256 - cmap->index;
X
X  ba = (struct gspregs *)gfp->g_regkva;
X
X  return 0;
X
X  return error;
X}
X
Xint
Xul_putcmap (gfp, cmap)
X     struct grf_softc *gfp;
X     struct grf_colormap *cmap;
X{
X	struct gspregs *ba;
X	short x;
X
X	if (cmap->count == 0 || cmap->index >= 256)
X		return 0;
X
X	if (cmap->index + cmap->count > 256)
X		cmap->count = 256 - cmap->index;
X
X	ba = (struct gspregs *)gfp->g_regkva;
X
X	ba->hstadrh = 0xfe80;
X	ba->hstadrl = 0x0000;
X	ba->ctrl |= INCW;
X	ba->data = cmap->index;
X	ba->ctrl &= ~INCW;
X
X	for (x=cmap->index; x<cmap->index+cmap->count; ++x) {
X		ba->data = (u_short)cmap->red[x];
X		ba->data = (u_short)cmap->green[x];
X		ba->data = (u_short)cmap->blue[x];
X	}
X
X	return 0;
X}
X
X/*
X * !!! THIS AREA UNDER CONSTRUCTION !!!
X */
Xint ul_BltOpMap[16] = {
X	3, 1, 2, 0, 11,  9, 10, 8, 
X	7, 5, 6, 4, 15, 13, 14, 12
X};
X
Xint
Xul_bitblt (gp, bb)
X     struct grf_softc *gp;
X     struct grf_bitblt *bb;
X{
X	return EINVAL;
X
X#if 0
X	volatile struct gsp_regs *ba;
X
X	
X#endif
X}
X
Xvoid
Xgsp_write(gsp, ptr, size)
X	struct gspregs *gsp;
X	u_short *ptr;
X	size_t size;
X{
X	u_short put, new_put, next, oc;
X	u_long put_hi, oa;
X	size_t n;
X	int s;
X
X	if (size == 0 || size > 8)
X	        return;
X
X	n = size;
X
X	oc = gsp->ctrl;
X	oa = GSPGETHADRS(gsp);
X
X	gsp->ctrl = oc & ~INCR | LBL | INCW;
X	GSPSETHADRS(gsp,GSP_MODE_ADRS);
X	gsp->data &= ~GMODE_FLUSH;
X
X	GSPSETHADRS(gsp,PUT_HI_PTR_ADRS);
X	put_hi = gsp->data << 16;
X
X	GSPSETHADRS(gsp,PUT_PTR_ADRS);
X	put = gsp->data;
X	new_put = put + (8<<4);
X
X	GSPSETHADRS(gsp,GET_PTR_ADRS);
X	next = gsp->data;
X	
X	while (next == new_put) {
X		/* XXX later tsleep() here */
X		GSPSETHADRS(gsp,GET_PTR_ADRS);
X		next = gsp->data;
X	}
X
X	GSPSETHADRS(gsp,put|put_hi);
X	gsp->data = *ptr++ | 8<<4;
X	while ( --n > 0) {
X		gsp->data = *ptr++;
X	}
X
X	GSPSETHADRS(gsp,PUT_PTR_ADRS);
X	gsp->data = new_put;
X	GSPSETHADRS(gsp,oa);
X	gsp->ctrl = oc;
X
X	return;
X}
X
X#endif	/* NGRF */
END-of-dev/grf_ul.c
echo x - dev/ite_ul.c
sed 's/^X//' >dev/ite_ul.c << 'END-of-dev/ite_ul.c'
X/*	$Id: ite_ul.c,v 1.1.1.5 1995/06/21 10:57:23 is Exp is $	*/
X
X/*
X * Copyright (c) 1995 Ignatios Souvatzis
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X *    notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X *    notice, this list of conditions and the following disclaimer in the
X *    documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X *    must display the following acknowledgement:
X *      This product includes software developed by Lutz Vieweg.
X * 4. The name of the author may not be used to endorse or promote products
X *    derived from this software without specific prior written permission
X *
X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
X * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
X * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
X * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
X * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
X * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
X * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
X */
X#include "grful.h"
X#if NGRFUL > 0
X
X#include <sys/param.h>
X#include <sys/conf.h>
X#include <sys/proc.h>
X#include <sys/device.h>
X#include <sys/ioctl.h>
X#include <sys/tty.h>
X#include <sys/systm.h>
X#include <dev/cons.h>
X#include <machine/cpu.h>
X#include <amiga/amiga/device.h>
X#include <amiga/amiga/isr.h>
X#include <amiga/dev/itevar.h>
X#include <amiga/dev/grfioctl.h>
X#include <amiga/dev/grfvar.h>
X#include <amiga/dev/grf_ulreg.h>
X
X#ifndef KFONT_CUSTOM  
X#ifdef KFONT_8X11
X#define kernel_font_width       kernel_font_width_8x11
X#define kernel_font_height      kernel_font_height_8x11
X#define kernel_font_baseline    kernel_font_baseline_8x11
X#define kernel_font_boldsmear   kernel_font_boldsmear_8x11
X#define kernel_font_lo  kernel_font_lo_8x11
X#define kernel_font_hi  kernel_font_hi_8x11
X#define kernel_font     kernel_font_8x11
X#define kernel_cursor   kernel_cursor_8x11
X#else
X#define kernel_font_width       kernel_font_width_8x8
X#define kernel_font_height      kernel_font_height_8x8
X#define kernel_font_baseline    kernel_font_baseline_8x8
X#define kernel_font_boldsmear   kernel_font_boldsmear_8x8
X#define kernel_font_lo  kernel_font_lo_8x8
X#define kernel_font_hi  kernel_font_hi_8x8
X#define kernel_font     kernel_font_8x8
X#define kernel_cursor   kernel_cursor_8x8
X#endif
X#endif
X
Xextern u_char kernel_font_width, kernel_font_height, kernel_font_baseline;
Xextern short  kernel_font_boldsmear;
Xextern u_char kernel_font_lo, kernel_font_hi;
Xextern u_char kernel_font[], kernel_cursor[];
X
X
X#ifdef DEBUG_UL
X#define gsp_out(ba,cmd,len) gsp_dump(cmd,len); gsp_write(ba,cmd,len)
X#else
X#define gsp_out(ba,cmd,len) gsp_write(ba,cmd,len)
X#endif
X
Xint ulowell_console = 1;
X
Xvoid ulowell_cursor __P((struct ite_softc *,int));
Xvoid ulowell_scroll __P((struct ite_softc *,int,int,int,int));
Xvoid ulowell_deinit __P((struct ite_softc *));
Xvoid ulowell_clear __P((struct ite_softc *,int,int,int,int));
Xvoid ulowell_putc __P((struct ite_softc *,int,int,int,int));
Xvoid ulowell_init __P((struct ite_softc *));
X
X#ifdef DEBUG_UL
Xvoid gsp_dump __P((u_short *,int));
X#endif
X
X#define UL_FG(ip) (ip->grf->g_display.gd_colors > 4 ? 0x0000 : 0xFFFF)
X#define UL_BG(ip) (ip->grf->g_display.gd_colors > 4 ? 0x0707 : 0x0000)
X
X/*
X * this function is called from grf_ul to init the grf_softc->g_conpri
X * field each time a ulowell board is attached.
X */
Xint
Xgrful_cnprobe()
X{
X	static int done;
X	int uv;
X
X	if (ulowell_console && done == 0)
X		uv = CN_INTERNAL;
X	else
X		uv = CN_NORMAL;
X	done = 1;
X	return(uv);
X}
X
X/* 
X * init the required fields in the grf_softc struct for a
X * grf to function as an ite.
X */
Xvoid
Xgrful_iteinit(gp)
X	struct grf_softc *gp;
X{
X	gp->g_iteinit = ulowell_init;
X	gp->g_itedeinit = ulowell_deinit;
X	gp->g_iteclear = ulowell_clear;
X	gp->g_iteputc = ulowell_putc;
X	gp->g_itescroll = ulowell_scroll;
X	gp->g_itecursor = ulowell_cursor;
X}
X
Xvoid
Xulowell_init(ip)
X	struct ite_softc *ip;
X{
X	struct gspregs *ba;
X
X	u_int16_t *sp;
X	u_int16_t cmd[8];
X
X	int i;
X
X	ba = (struct gspregs *) ip->grf->g_regkva;
X
X	ip->font     = kernel_font;
X	ip->font_lo  = kernel_font_lo;
X	ip->font_hi  = kernel_font_hi;
X	ip->ftwidth  = kernel_font_width;
X	ip->ftheight = kernel_font_height;
X	ip->ftbaseline = kernel_font_baseline;
X	ip->ftboldsmear = kernel_font_boldsmear;
X
X	/* upload font data */
X
X	ba->hstadrh = 0xFFA2; 
X	ba->hstadrl = 0x0200; 
X
X	ba->data = 0x0000; 
X	ba->data = 0xFFA3; 
X	ba->data = ip->ftwidth; 
X	ba->data = ip->ftheight; 
X	ba->data = ip->ftwidth-1;
X	ba->data = 1;
X	ba->data = ip->font_lo;
X	ba->data = ip->font_hi;
X    
X	ba->hstadrh = 0xFFA3; 
X	ba->hstadrl = 0x0000; 
X    
X	/*      
X	 * font has to be word aligned and padded to word boundary.
X	 * 8 bit wide fonts will be byte swapped in the bit swap
X	 * routine.
X	 */      
X	for (i=ip->font_lo * ip->ftheight, sp = (u_short *)ip->font;
X	    i<= ip->font_hi * ip->ftheight; ++i,++sp) {
X		ba->data = *sp;
X	}       
X
X	/* bitwise mirror the font: */
X
X	cmd[0] = GCMD_FNTMIR;
X	gsp_out(ba, cmd, 1);
X
X	ip->priv = NULL;	
X	ip->cursor_opt = 0;
X
X	if (ip->ftwidth >0 && ip->ftheight > 0) {
X		ip->cols = ip->grf->g_display.gd_dwidth  / ip->ftwidth;
X		ip->rows = ip->grf->g_display.gd_dheight / ip->ftheight;
X	}
X
X	ulowell_clear(ip, 0, 0, ip->rows, ip->cols);
X
X}
X
X
Xvoid ulowell_cursor(struct ite_softc *ip, int flag)
X{
X	volatile struct gspregs *ba;
X	u_short cmd[7];
X	int pos;
X
X	ba = (struct gspregs *)ip->grf->g_regkva;
X
X	if (flag == END_CURSOROPT)
X		--ip->cursor_opt;
X	else if (flag == START_CURSOROPT) {
X		if (!ip->cursor_opt)
X			ulowell_cursor(ip, ERASE_CURSOR);
X		++ip->cursor_opt;
X		return;		/* if we are already opted */
X	}
X
X	if (ip->cursor_opt)
X		return;		/* if we are still nested. */
X
X	/* else we draw the cursor */
X
X	if (flag != DRAW_CURSOR && flag != END_CURSOROPT) {
X		/* erase cursor */
X		cmd[0] = GCMD_PIXBLT;
X		cmd[1] = 1024 - ip->ftwidth;
X		cmd[2] = 1024 - ip->ftheight;
X		cmd[3] = ip->ftwidth;
X		cmd[4] = ip->ftheight;
X		cmd[5] = ip->cursorx * ip->ftwidth;
X		cmd[6] = ip->cursory * ip->ftheight;
X		gsp_out(ba, cmd, 7);
X	}
X		
X	if (flag != DRAW_CURSOR && flag != MOVE_CURSOR &&
X	    flag != END_CURSOROPT)
X		return;
X
X	/* draw cursor */
X
X	ip->cursorx = min(ip->curx, ip->cols-1);
X	ip->cursory = ip->cury;
X
X	cmd[0] = GCMD_PIXBLT;
X	cmd[1] = ip->cursorx * ip->ftwidth;
X	cmd[2] = ip->cursory * ip->ftheight;
X	cmd[3] = ip->ftwidth;
X	cmd[4] = ip->ftheight;
X	cmd[5] = 1024 - ip->ftwidth;
X	cmd[6] = 1024 - ip->ftheight;
X	gsp_out(ba, cmd, 7);
X
X	cmd[0] = GCMD_FILL;
X	cmd[1] = 0xffff; /* XXX */
X	cmd[2] = ip->cursorx * ip->ftwidth;
X	cmd[3] = ip->cursory * ip->ftheight;
X	cmd[4] = ip->ftwidth;
X	cmd[5] = ip->ftheight;
X	cmd[6] = 10;	/* thats src xor dst */
X
X	gsp_out(ba, cmd, 7);
X
X}
X
X
X
Xstatic void screen_up (struct ite_softc *ip, int top, int bottom, int lines)
X{	
X	volatile struct gspregs *ba;
X	const struct MonDef *md; 
X
X	u_short cmd[7];
X
X	ba = (struct gspregs *)ip->grf->g_regkva;
X	md = (struct MonDef *)ip->priv;
X
X#ifdef DEBUG_UL
X	printf("screen_up %d %d %d ->",top,bottom,lines);
X#endif
X	/* do some bounds-checking here.. */
X
X	if (top >= bottom)
X		return;
X	  
X	if (top + lines >= bottom)
X	{
X		ulowell_clear (ip, top, 0, bottom - top, ip->cols);
X		return;
X	}
X
X	cmd[0] = GCMD_PIXBLT;
X	cmd[1] = 0;					/* x */
X	cmd[2] = top			* ip->ftheight;	/* y */
X	cmd[3] = ip->cols		* ip->ftwidth;	/* w */
X	cmd[4] = (bottom-top+1)		* ip->ftheight;	/* h */
X	cmd[5] = 0;					/* dst x */
X	cmd[6] = (top-lines)  		* ip->ftheight;	/* dst y */
X	gsp_out(ba, cmd, 7);
X
X	ulowell_clear(ip, bottom-lines+1, 0, lines-1, ip->cols);
X};
X
Xstatic void screen_down (struct ite_softc *ip, int top, int bottom, int lines)
X{	
X	volatile struct gspregs *ba;
X	const struct MonDef *md;
X
X	u_short cmd[7];
X
X	ba = (struct gspregs *)ip->grf->g_regkva;
X	md = (struct MonDef *)ip->priv;
X
X#ifdef DEBUG_UL
X	printf("screen_down %d %d %d ->",top,bottom,lines);
X#endif
X
X	/* do some bounds-checking here.. */
X
X	if (top >= bottom)
X		return;
X	  
X	if (top + lines >= bottom)
X	{
X	    ulowell_clear (ip, top, 0, bottom - top, ip->cols);
X	    return;
X	}
X
X	cmd[0] = GCMD_PIXBLT;
X	cmd[1] = 0;					/* x */
X	cmd[2] = top			* ip->ftheight;	/* y */
X	cmd[3] = ip->cols		* ip->ftwidth;	/* w */
X	cmd[4] = (bottom - top - lines)	* ip->ftheight;	/* h */
X	cmd[5] = 0;					/* dst x */
X	cmd[6] = (top + lines)		* ip->ftheight;	/* dst y */
X	gsp_out(ba, cmd, 7);
X
X	ulowell_clear(ip, top, 0, lines, ip->cols);
X};
X
Xvoid ulowell_deinit(struct ite_softc *ip)
X{
X	ip->flags &= ~ITE_INITED;
X}
X
X
Xvoid ulowell_putc(struct ite_softc *ip, int c, int dy, int dx, int mode)
X{
X	struct gspregs *ba;
X	struct MonDef *md;
X	register u_char attr;
X	u_short cmd[8];
X	
X	ba = (struct gspregs *)ip->grf->g_regkva;
X
X	cmd[0] = GCMD_CHAR;
X	cmd[1] = c;
X	if (mode & ATTR_INV) {
X		cmd[3] = 0x0;
X		cmd[2] = 0xffff;
X	} else {
X		cmd[2] = 0x0;
X		cmd[3] = 0xffff;
X	}
X	cmd[4] = dx * ip->ftwidth;
X	cmd[5] = dy * ip->ftheight;
X	cmd[6] = mode;
X	gsp_write(ba, cmd, 7);
X
X	if (mode & ATTR_UL) {
X		cmd[0] = GCMD_FILL;
X		cmd[1] = cmd[3];
X		cmd[2] = cmd[4];
X		cmd[3] = cmd[5] + ip->ftbaseline;
X		cmd[4] = ip->ftwidth;
X		cmd[5] = 1;
X		cmd[6] = 0;	/* replace */
X		gsp_write(ba, cmd, 7);
X	}
X}
X
Xvoid ulowell_clear(struct ite_softc *ip, int sy, int sx, int h, int w)
X{
X	/* XXX TBD */
X	struct gspregs * ba;
X	struct MonDef *md;
X
X	u_short cmd[7];
X
X#ifdef	DEBUG_UL
X	printf("ulowell_clear %d %d %d %d ->",sy,sx,h,w);
X#endif
X	ba = (struct gspregs *)ip->grf->g_regkva;
X	md = (struct MonDef *)ip->priv;
X
X	cmd[0] = GCMD_FILL;
X	cmd[1] = 0x0; /* XXX */
X	cmd[2] = sx * ip->ftwidth;
X	cmd[3] = sy * ip->ftheight;
X	cmd[4] = w * ip->ftwidth;
X	cmd[5] = h * ip->ftheight;
X	cmd[6] = 0;
X
X	gsp_out(ba, cmd, 7);
X}
X
Xvoid ulowell_scroll(struct ite_softc *ip, int sy, int sx, int count, int dir)
X{
X	struct gspregs *ba;
X	struct MonDef *md;
X
X	register int height, dy, i;
X	u_short cmd[7];
X
X	ba = (struct gspregs *)ip->grf->g_regkva;
X	md = (struct MonDef *)ip->priv;
X
X#ifdef DEBUG_UL
X	printf("ulowell_scroll %d %d %d %d ->",sy,sx,count,dir);
X#endif
X
X	ulowell_cursor(ip, ERASE_CURSOR);
X
X	if (dir == SCROLL_UP) {
X		screen_up (ip, sy, ip->bottom_margin, count);
X	} else if (dir == SCROLL_DOWN) {
X		screen_down (ip, sy, ip->bottom_margin, count);
X	} else if (dir == SCROLL_RIGHT) {
X		cmd[0] = GCMD_PIXBLT;
X		cmd[1] = sx * ip->ftwidth;
X		cmd[2] = sy * ip->ftheight;
X		cmd[3] = (ip->cols - sx - count) * ip->ftwidth;
X		cmd[4] = ip->ftheight;
X		cmd[5] = (sx + count) * ip->ftwidth;
X		cmd[6] = sy * ip->ftheight;
X		gsp_out(ba,cmd,7);
X		ulowell_clear (ip, sy, sx, 1, count);
X	} else {
X		cmd[0] = GCMD_PIXBLT;
X		cmd[1] = sx * ip->ftwidth;
X		cmd[2] = sy * ip->ftheight;
X		cmd[3] = (ip->cols - sx) * ip->ftwidth;
X		cmd[4] = ip->ftheight;
X		cmd[5] = (sx - count) * ip->ftwidth;
X		cmd[6] = sy * ip->ftheight;
X		gsp_out(ba,cmd,7);
X		ulowell_clear (ip, sy, ip->cols - count, 1, count);
X	}		
X}
X
X#ifdef DEBUG_UL
Xvoid
Xgsp_dump(cmd,len)
X	u_short *cmd;
X	int len;
X{
X	printf("gsp");
X	while (len-- > 0)
X		printf(" %lx",*cmd++);
X	printf("\n");
X}
X#endif
X#endif /* NGRFUL */
END-of-dev/ite_ul.c
echo x - dev/grf_ultmscode.h
sed 's/^X//' >dev/grf_ultmscode.h << 'END-of-dev/grf_ultmscode.h'
X#define TMSADDR1 0xffa20000
Xstatic u_short tmsblock1[] = {
X	0x0000,	0xffa1,	0x0000,	0xffa1,	0x0000,	0x0000,	0x0000,
X};
X#define TMSSIZE1 7
X
X#define TMSADDR2 0xffa20120
Xstatic u_short tmsblock2[] = {
X	0x0008,	0x0008,	0x0400,	0x0300,	0x0000,	0xfe00,	0x2000,
X	0x0008,
X};
X#define TMSSIZE2 8
X
X#define TMSADDR3 0xffa20200
Xstatic u_short tmsblock3[] = {
X	0x0000,	0xffa3,	0x0008,	0x0008,	0x0006,	0x0001,	0x0020,
X	0x00ff,	0x0000,	0x0000,	0x0000,	0x0000,	0x4e20,	0x0000,
X	0x0000,	0x0404,	0x0404,	0x0f0f,	0x0f0f,	0x0b0b,	0x0b0b,
X	0x0707,	0x0707,	0x0390,	0xffa2,
X};
X#define TMSSIZE3 25
X
X#define TMSADDR4 0xffa00000
Xstatic u_short tmsblock4[] = {
X	0x0550,	0x0740,	0x09cf,	0xf000,	0x09c0,	0x0000,	0x0580,
X	0x0000,	0xfe80,	0x09e1,	0x0030,	0xfe80,	0x09c0,	0x0080,
X	0x8001,	0x8001,	0x8001,	0x09c0,	0x0000,	0x8001,	0x8001,
X	0x8001,	0x8001,	0x8001,	0x8001,	0x8001,	0x8001,	0x8001,
X	0x18c0,	0x0580,	0x0000,	0xfe80,	0x1960,	0x0580,	0x0020,
X	0xfe80,	0x05b3,	0x0180,	0xffa2,	0x07b4,	0x0160,	0xffa2,
X	0x07b8,	0x02f0,	0xffa2,	0x6a70,	0x0590,	0x0140,	0xc000,
X	0x05a0,	0x00b0,	0xc000,	0x0b80,	0x7fe0,	0x0000,	0x0580,
X	0x00b0,	0xc000,	0x05a0,	0x0190,	0xffa2,	0x0580,	0x0150,
X	0xc000,	0x05a0,	0x0150,	0xc000,	0x4c92,	0x09d9,	0x0000,
X	0x07b7,	0x0140,	0xffa2,	0x0fc0,	0x07a0,	0x0020,	0xffa2,
X	0xc006,	0x5684,	0x8080,	0xe020,	0x0780,	0x0020,	0xffa2,
X	0x07a3,	0x0000,	0xffa2,	0x8401,	0x4c22,	0x0b81,	0x000f,
X	0xffff,	0xcaf7,	0x4403,	0xcaf5,	0x0b82,	0xfff0,	0xffff,
X	0xcaeb,	0x1422,	0xcb1e,	0x4e0a,	0x955c,	0x955c,	0x05bb,
X	0x0260,	0xffa2,	0x457c,	0x07b7,	0x0220,	0xffa2,	0x5631,
X	0xecf1,	0x6a30,	0x0590,	0x0130,	0xc000,	0x4c3d,	0x4cfb,
X	0x2e1b,	0x5fbb,	0x5f9b,	0x07b0,	0x0200,	0xffa2,	0x4170,
X	0x9558,	0x9559,	0x9752,	0x0fa0,	0xc0cb,	0x1422,	0xcb18,
X	0x4e0a,	0x9559,	0x9559,	0x9752,	0x9757,	0x05b0,	0x00b0,
X	0xc000,	0xa01f,	0x9550,	0x0545,	0x0590,	0x00ba,	0xc000,
X	0x0550,	0x05b0,	0x00b0,	0xc000,	0x0fe0,	0x95f0,	0x0590,
X	0x00b0,	0xc000,	0xc0b1,	0x1422,	0xcb22,	0x4e0a,	0x05c0,
X	0x0140,	0xc000,	0x0130,	0xc000,	0x9550,	0x9750,	0x9757,
X	0x9752,	0x4c71,	0x05bb,	0x00b0,	0xc000,	0x0b9b,	0x0300,
X	0x0000,	0xe412,	0xc803,	0x0bbb,	0x0200,	0x0000,	0xcc03,
X	0x0bbb,	0x0100,	0x0000,	0x059b,	0x00b0,	0xc000,	0x05bb,
X	0x00b0,	0xc000,	0x0f60,	0xc08d,	0x1422,	0xcb38,	0x05a6,
X	0x0270,	0xffa2,	0x05a5,	0x0260,	0xffa2,	0x44a6,	0x1026,
X	0x05a5,	0x0230,	0xffa2,	0x5ec5,	0x07a6,	0x0200,	0xffa2,
X	0x84c7,	0x5708,	0x2fe7,	0x4308,	0x2fe7,	0x4308,	0x2fe7,
X	0x4308,	0x2fe7,	0x4308,	0x2fe7,	0x4308,	0x2fe7,	0x4308,
X	0x2fe7,	0x4308,	0x2fe7,	0x4308,	0x2fe7,	0x4308,	0x2fe7,
X	0x4308,	0x2fe7,	0x4308,	0x2fe7,	0x4308,	0x2fe7,	0x4308,
X	0x2fe7,	0x4308,	0x2fe7,	0x4308,	0x2fe7,	0x4308,	0x9106,
X	0x0d85,	0xffdb,	0xc080,	0x04e0,	0xffa0,	0x0300,	0xc080,
X	0x04e0,	0xffa0,
X};
X#define TMSSIZE4 254
X
Xstatic struct tmscode {
X	u_long startaddr;
X	u_short *datptr;
X	u_long size;
X} tmscode[] = {
X	{TMSADDR1, tmsblock1, TMSSIZE1},
X	{TMSADDR2, tmsblock2, TMSSIZE2},
X	{TMSADDR3, tmsblock3, TMSSIZE3},
X	{TMSADDR4, tmsblock4, TMSSIZE4},
X};
X
X#define NTMSBLOCKS 4
X#define TMSSTART 0xffa00000
END-of-dev/grf_ultmscode.h
exit