home *** CD-ROM | disk | FTP | other *** search
- Article 91 of comp.sources.misc:
- Path: tut!osu-cis!cbosgd!mandrill!hal!ncoast!allbery
- From: nwd@j.cc.purdue.edu (Daniel Lawrence)
- Newsgroups: comp.sources.misc
- Subject: MicroEmacs 3.9 (Part 14 of 16)
- Message-ID: <5690@ncoast.UUCP>
- Date: 17 Nov 87 02:36:14 GMT
- Sender: allbery@ncoast.UUCP
- Lines: 971
- Approved: allbery@ncoast.UUCP
- X-Archive: comp.sources.misc/microemacs-3.9/13
-
- # This is a shar archive.
- # Remove everything above this line.
- # Run the file through sh, not csh.
- # (type `sh mes.14')
- # If you do not see the message
- # `mes.14 completed!'
- # then the file was incomplete.
- echo extracting - z309.c
- sed 's/^X//' > z309.c << 'FRIDAY_NIGHT'
- X/*
- X * The routines in this file provide support for the Zenith Z-100 PC
- X * family. It goes directly to the graphics RAM to do screen output.
- X * It compiles into nothing if not a Zenith driver.
- X */
- X
- X#define termdef 1 /* don't define "term" external */
- X
- X#include <stdio.h>
- X#include "estruct.h"
- X#include "edef.h"
- X
- X#if Z309
- X
- X/* set NROW to 25 for 25-line interlaced mode */
- X#define NROW 50 /* Screen size. */
- X#define NCOL 80 /* Edit if you want to. */
- X#define MARGIN 8 /* size of minimim margin and */
- X#define SCRSIZ 64 /* scroll size for extended lines */
- X#define NPAUSE 200 /* # times thru update to pause */
- X#define BEL 0x07 /* BEL character. */
- X#define ESC 0x1B /* ESC character. */
- X#define SPACE 32 /* space character */
- X
- X#define SCADC 0xb8000000L /* CGA address of screen RAM */
- X#define SCADM 0xb0000000L /* MONO address of screen RAM */
- X
- X#define CDMONO 0 /* monochrome text card */
- X#define CDCGA50 1 /* 50-line color graphics card */
- X#define CDCGI25 2 /* 25-line interlaced CGA text */
- X#define CDCGA25 3 /* 25-line color graphics card */
- X#define CDSENSE 9 /* detect the card type */
- X
- Xint dtype = CDCGA50; /* current display type */
- Xlong scadd; /* address of screen ram */
- Xint *scptr[NROW]; /* pointer to screen lines */
- Xint sline[NCOL]; /* screen line image */
- Xextern union REGS rg; /* cpu register for use of DOS calls */
- X
- Xextern int ttopen(); /* Forward references. */
- Xextern int ttgetc();
- Xextern int ttputc();
- Xextern int ttflush();
- Xextern int ttclose();
- Xextern int z309move();
- Xextern int z309eeol();
- Xextern int z309eeop();
- Xextern int z309beep();
- Xextern int z309open();
- Xextern int z309rev();
- Xextern int z309cres();
- Xextern int z309close();
- Xextern int z309putc();
- Xextern int z309kopen();
- Xextern int z309kclose();
- X
- X#if COLOR
- Xextern int z309fcol();
- Xextern int z309bcol();
- X
- Xint cfcolor = -1; /* current forground color */
- Xint cbcolor = -1; /* current background color */
- Xint ctrans[] = /* ansi to z309 color translation table */
- X {0, 4, 2, 6, 1, 5, 3, 7};
- X#endif
- X
- X/*
- X * Standard terminal interface dispatch table. Most of the fields point into
- X * "termio" code.
- X */
- XTERM term = {
- X NROW-1,
- X NROW-1,
- X NCOL,
- X NCOL,
- X MARGIN,
- X SCRSIZ,
- X NPAUSE,
- X z309open,
- X z309close,
- X z309kopen,
- X z309kclose,
- X ttgetc,
- X z309putc,
- X ttflush,
- X z309move,
- X z309eeol,
- X z309eeop,
- X z309beep,
- X z309rev,
- X z309cres
- X#if COLOR
- X , z309fcol,
- X z309bcol
- X#endif
- X};
- X
- Xextern union REGS rg;
- X
- X#if COLOR
- Xz309fcol(color) /* set the current output color */
- X
- Xint color; /* color to set */
- X
- X{
- X cfcolor = ctrans[color];
- X}
- X
- Xz309bcol(color) /* set the current background color */
- X
- Xint color; /* color to set */
- X
- X{
- X cbcolor = ctrans[color];
- X}
- X#endif
- Xz309move(row, col)
- X{
- X rg.h.ah = 2; /* set cursor position function code */
- X rg.h.dl = col;
- X rg.h.dh = row;
- X rg.h.bh = 0; /* set screen page number */
- X int86(0x10, &rg, &rg);
- X}
- X
- Xz309eeol() /* erase to the end of the line */
- X
- X{
- X int attr; /* attribute byte mask to place in RAM */
- X int *lnptr; /* pointer to the destination line */
- X int i;
- X int ccol; /* current column cursor lives */
- X int crow; /* row */
- X
- X /* find the current cursor position */
- X rg.h.ah = 3; /* read cursor position function code */
- X rg.h.bh = 0; /* current video page */
- X int86(0x10, &rg, &rg);
- X ccol = rg.h.dl; /* record current column */
- X crow = rg.h.dh; /* and row */
- X
- X /* build the attribute byte and setup the screen pointer */
- X#if COLOR
- X if (dtype != CDMONO)
- X attr = (((cbcolor & 15) << 4) | (cfcolor & 15)) << 8;
- X else
- X attr = 0x0700;
- X#else
- X attr = 0x0700;
- X#endif
- X lnptr = &sline[0];
- X for (i=0; i < term.t_ncol; i++)
- X *lnptr++ = SPACE | attr;
- X
- X#if 0 /* Heath/Zenith builds flicker-less CGAs */
- X if (flickcode) {
- X /* wait for vertical retrace to be off */
- X while ((inp(0x3da) & 8))
- X ;
- X
- X /* and to be back on */
- X while ((inp(0x3da) & 8) == 0)
- X ;
- X }
- X#endif
- X
- X /* and send the string out */
- X movmem(&sline[0], scptr[crow]+ccol, (term.t_ncol-ccol)*2);
- X
- X}
- X
- Xz309putc(ch) /* put a character at the current position in the
- X current colors */
- X
- Xint ch;
- X
- X{
- X rg.h.ah = 14; /* write char to screen with current attrs */
- X rg.h.al = ch;
- X#if COLOR
- X if (dtype != CDMONO)
- X rg.h.bl = cfcolor;
- X else
- X rg.h.bl = 0x07;
- X#else
- X rg.h.bl = 0x07;
- X#endif
- X int86(0x10, &rg, &rg);
- X}
- X
- Xz309eeop()
- X{
- X int attr; /* attribute to fill screen with */
- X
- X rg.h.ah = 6; /* scroll page up function code */
- X rg.h.al = 0; /* # lines to scroll (clear it) */
- X rg.x.cx = 0; /* upper left corner of scroll */
- X/*HERE*/ rg.x.dx = 0x184f; /* lower right corner of scroll */
- X#if COLOR
- X if (dtype != CDMONO)
- X attr = ((ctrans[gbcolor] & 15) << 4) | (ctrans[gfcolor] & 15);
- X else
- X attr = 0;
- X#else
- X attr = 0;
- X#endif
- X rg.h.bh = attr;
- X int86(0x10, &rg, &rg);
- X}
- X
- Xz309rev(state) /* change reverse video state */
- X
- Xint state; /* TRUE = reverse, FALSE = normal */
- X
- X{
- X /* This never gets used under the z309-PC driver */
- X}
- X
- Xz309cres(res) /* change screen resolution */
- X
- Xchar *res; /* resolution to change to */
- X
- X{
- X if (strcmp(res, "CGA50") == 0) {
- X scinit(CDCGA50);
- X return(TRUE);
- X } else if (strcmp(res, "MONO") == 0) {
- X scinit(CDMONO);
- X return(TRUE);
- X } else
- X return(FALSE);
- X}
- X
- Xz309beep()
- X{
- X#if MWC86
- X putcnb(BEL);
- X#else
- X bdos(6, BEL, 0);
- X#endif
- X}
- X
- Xz309open()
- X{
- X scinit(CDSENSE);
- X revexist = TRUE;
- X ttopen();
- X}
- X
- Xz309close()
- X
- X{
- X rg.h.ah = 101;
- X rg.h.al = 1; /* 25-line interlace mode */
- X int86(0x10, &rg, &rg);
- X#if COLOR
- X z309fcol(7);
- X z309bcol(0);
- X#endif
- X ttclose();
- X}
- X
- Xz309kopen() /* open the keyboard */
- X
- X{
- X}
- X
- Xz309kclose() /* close the keyboard */
- X
- X{
- X}
- X
- Xscinit(type) /* initialize the screen head pointers */
- X
- Xint type; /* type of adapter to init for */
- X
- X{
- X union {
- X long laddr; /* long form of address */
- X int *paddr; /* pointer form of address */
- X } addr;
- X int i;
- X
- X /* if asked...find out what display is connected */
- X int86(0x11, &rg, &rg);
- X dtype = CDCGA50;
- X scadd = SCADC;
- X strcpy(sres, "CGA50");
- X if ((((rg.x.ax >> 4) & 11) == 3) || type == CDMONO) {
- X strcpy(sres, "MONO");
- X dtype = CDMONO;
- X scadd = SCADM;
- X }
- X else {
- X rg.h.ah = 101;
- X/* set al = 1 for 25-line interlace mode */
- X rg.h.al = 2; /* 50-line interlace mode */
- X int86(0x10, &rg, &rg);
- X }
- X
- X /* initialize the screen pointer array */
- X for (i = 0; i < NROW; i++) {
- X addr.laddr = scadd + (long)(NCOL * i * 2);
- X scptr[i] = addr.paddr;
- X }
- X}
- X
- Xscwrite(row, outstr, forg, bacg) /* write a line out*/
- X
- Xint row; /* row of screen to place outstr on */
- Xchar *outstr; /* string to write out (must be term.t_ncol long) */
- Xint forg; /* forground color of string to write */
- Xint bacg; /* background color */
- X
- X{
- X int attr; /* attribute byte mask to place in RAM */
- X int *lnptr; /* pointer to the destination line */
- X int i;
- X
- X /* build the attribute byte and setup the screen pointer */
- X#if COLOR
- X if (dtype != CDMONO)
- X attr = (((ctrans[bacg] & 15) << 4) | (ctrans[forg] & 15)) << 8;
- X else
- X attr = (((bacg & 15) << 4) | (forg & 15)) << 8;
- X#else
- X attr = (((bacg & 15) << 4) | (forg & 15)) << 8;
- X#endif
- X lnptr = &sline[0];
- X for (i=0; i<term.t_ncol; i++)
- X *lnptr++ = (outstr[i] & 255) | attr;
- X
- X#if 0 /* Heath/Zenith builds flicker-less CGAs */
- X if (flickcode) {
- X /* wait for vertical retrace to be off */
- X while ((inp(0x3da) & 8))
- X ;
- X
- X /* and to be back on */
- X while ((inp(0x3da) & 8) == 0)
- X ;
- X }
- X#endif
- X
- X /* and send the string out */
- X movmem(&sline[0], scptr[row],term.t_ncol*2);
- X}
- X
- X#if FLABEL
- Xfnclabel(f, n) /* label a function key */
- X
- Xint f,n; /* default flag, numeric argument [unused] */
- X
- X{
- X /* on machines with no function keys...don't bother */
- X return(TRUE);
- X}
- X#endif
- X#else
- Xz309hello()
- X{
- X}
- X#endif
- FRIDAY_NIGHT
- echo extracting - makefile.mwc
- sed 's/^X//' > makefile.mwc << 'FRIDAY_NIGHT'
- X#
- X# Makefile for MicroEMACS 3.9 on the Atari ST using Mark Williams C
- X#
- XSRC=.
- XCC=cc
- XCFLAGS=-I. -A
- X
- XOBJS= basic.o bind.o buffer.o crypt.o display.o eval.o exec.o file.o\
- X fileio.o input.o isearch.o line.o main.o random.o region.o search.o\
- X spawn.o st520.o termio.o word.o window.o
- X
- Xemacs.prg: $(OBJS)
- X $(CC) -o emacs.prg $(OBJS)
- X
- Xbasic.o: $(SRC)\basic.c ebind.h epath.h efunc.h edef.h estruct.h
- Xbind.o: $(SRC)\bind.c ebind.h epath.h efunc.h edef.h estruct.h
- Xbuffer.o: $(SRC)\buffer.c ebind.h epath.h efunc.h edef.h estruct.h
- Xcrypt.o: $(SRC)\crypt.c ebind.h epath.h efunc.h edef.h estruct.h
- Xdisplay.o: $(SRC)\display.c ebind.h epath.h efunc.h edef.h estruct.h
- Xeval.o: $(SRC)\eval.c ebind.h epath.h efunc.h edef.h estruct.h evar.h
- Xexec.o: $(SRC)\exec.c ebind.h epath.h efunc.h edef.h estruct.h
- Xfile.o: $(SRC)\file.c ebind.h epath.h efunc.h edef.h estruct.h
- Xfileio.o: $(SRC)\fileio.c ebind.h epath.h efunc.h edef.h estruct.h
- Xinput.o: $(SRC)\input.c ebind.h epath.h efunc.h edef.h estruct.h
- Xisearch.o: $(SRC)\isearch.c ebind.h epath.h efunc.h edef.h estruct.h
- Xline.o: $(SRC)\line.c ebind.h epath.h efunc.h edef.h estruct.h
- Xmain.o: $(SRC)\main.c ebind.h efunc.h edef.h estruct.h
- Xrandom.o: $(SRC)\random.c ebind.h epath.h efunc.h edef.h estruct.h
- Xregion.o: $(SRC)\region.c ebind.h epath.h efunc.h edef.h estruct.h
- Xsearch.o: $(SRC)\search.c ebind.h epath.h efunc.h edef.h estruct.h
- Xspawn.o: $(SRC)\spawn.c ebind.h epath.h efunc.h edef.h estruct.h
- Xst520.o: $(SRC)\st520.c ebind.h epath.h efunc.h edef.h estruct.h
- Xtermio.o: $(SRC)\termio.c ebind.h epath.h efunc.h edef.h estruct.h
- Xword.o: $(SRC)\word.c ebind.h epath.h efunc.h edef.h estruct.h
- Xwindow.o: $(SRC)\window.c ebind.h epath.h efunc.h edef.h estruct.h
- FRIDAY_NIGHT
- echo extracting - makefile.unx
- sed 's/^X//' > makefile.unx << 'FRIDAY_NIGHT'
- XCFLAGS= -O
- X
- XOFILES= ansi.o basic.o bind.o buffer.o crypt.o dg10.o \
- X display.o eval.o exec.o file.o fileio.o \
- X hp110.o hp150.o ibmpc.o input.o isearch.o line.o \
- X lock.o main.o random.o region.o search.o spawn.o \
- X st520.o tcap.o termio.o tipc.o vmsvt.o vt52.o \
- X window.o word.o z309.o
- X
- XCFILES= ansi.c basic.c bind.c buffer.c crypt.c dg10.c \
- X display.c eval.c exec.c file.c fileio.c \
- X hp110.c hp150.c ibmpc.c input.c isearch.c line.c \
- X lock.c main.c random.c region.c search.c spawn.c \
- X st520.c tcap.c termio.c tipc.c vmsvt.c vt52.c \
- X window.c word.c z309.c
- X
- XHFILES= estruct.h edef.h efunc.h epath.h ebind.h evar.h
- X
- Xemacs: $(OFILES)
- X $(CC) $(CFLAGS) $(OFILES) -ltermcap -lc -o emacs
- X
- X$(OFILES): $(HFILES)
- FRIDAY_NIGHT
- echo extracting - aline.h
- sed 's/^X//' > aline.h << 'FRIDAY_NIGHT'
- X
- X /***********************************************\
- X * *
- X * aline.h *
- X * Common include file for C interface *
- X * to low level Line A calls *
- X * *
- X * J.R. Bammi *
- X * decvax!cwruecmp!bammi *
- X * bammi%cwru.edu.CSNET *
- X * bammi@cwru.edu.ARPA *
- X * CIS: 71515,155 *
- X * *
- X \***********************************************/
- X
- X#define WORD int
- X#define VOID void
- X
- X/*****************************************************************************\
- X* *
- X* Defines *
- X* *
- X\*****************************************************************************/
- X
- X/*
- X * Object colors (default pallette)
- X *
- X */
- X#define WHITE 0
- X#define BLACK 1
- X#define RED 2
- X#define GREEN 3
- X#define BLUE 4
- X#define CYAN 5
- X#define YELLOW 6
- X#define MAGENTA 7
- X#define LWHITE 8
- X#define LBLACK 9
- X#define LRED 10
- X#define LGREEN 11
- X#define LBLUE 12
- X#define LCYAN 13
- X#define LYELLOW 14
- X#define LMAGENTA 15
- X
- X
- X/*
- X * Vdi writing modes
- X *
- X */
- X#define MD_REPLACE 1
- X#define MD_TRANS 2
- X#define MD_XOR 3
- X#define MD_ERASE 4
- X
- X
- X/*
- X * Raster Op Codes
- X *
- X */
- X#define ALL_WHITE 0
- X#define S_AND_D 1
- X#define S_AND_NOTD 2
- X#define S_ONLY 3
- X#define NOTS_AND_D 4
- X#define D_ONLY 5
- X#define S_XOR_D 6
- X#define S_OR_D 7
- X#define NOT_SORD 8
- X#define NOT_SXORD 9
- X#define D_INVERT 10
- X#define NOT_D 11
- X#define S_OR_NOTD 12
- X#define NOTS_OR_D 13
- X#define NOT_SANDD 14
- X#define ALL_BLACK 15
- X
- X/*
- X * Sprite formats
- X *
- X */
- X#define SP_VDI 0
- X#define SP_XOR 1
- X
- X/*
- X * Line A Opcodes
- X *
- X */
- X#define INIT 0
- X#define PUTPIXEL 1
- X#define GETPIXEL 2
- X#define LINE 3
- X#define HLINE 4
- X#define RECTANGLE 5
- X#define FPOLYGON 6
- X#define BITBLT 7
- X#define TEXTBLT 8
- X#define SHOWMOUSE 9
- X#define HIDEMOUSE 10
- X#define TRANMOUSE 11
- X#define USPRITE 12
- X#define DSPRITE 13
- X#define CPYRASTER 14
- X#define FSEEDFILL 15 /* ROM TOS only */
- X
- X
- X/*****************************************************************************\
- X* *
- X* Types *
- X* *
- X\*****************************************************************************/
- X
- X /*
- X * Global Variables at negative offsets from the Line A parameter
- X * block address returned by init. (I have no way of telling if this
- X * list is complete).
- X *
- X */
- X/* Name Offset Type Description */
- X/* --------------------------------------------------------------------------*/
- X/* V_Y_MAX -4 W Max Y pixel value of the screen */
- X/* V_STATUS -6 W Text Status byte */
- X/* Bit Field Zero One */
- X/* 0 cursor flash disabled enabled */
- X/* 1 flash state off on */
- X/* 2 cursor visible no yes */
- X/* 3 end of line no-wrap wrap */
- X/* 4 inverse video on off */
- X/* 5 cursor saved false true */
- X/* V_OFF_AD -10 L Font offset table address */
- X/* V_X_MAX -12 W Max X pixel value */
- X/* V_FNT_WR -14 W Width of Font Form in bytes (see type FONT below) */
- X/* V_FNT_ST -16 W First font ASCII code (first_ade) */
- X/* V_FNT_ND -18 W Last font ASCII code (last_ade ) */
- X/* V_FNT_AD -22 L Font Form address */
- X/* Mono Spaced, 8 pixels wide and byte aligned, any ht. */
- X/* V_CUR_TIM -23 B Cursor countdown timer */
- X/* V_CUR_CNT -24 B Cursor flash interval( in frames) */
- X/* V_CUR_CY -26 W Y cursor position */
- X/* V_CUR_CX -28 W X cursor position */
- X/* V_CUR_OFF -30 W Offset from screen base to first cell (bytes) */
- X/* V_CUR_AD -34 L Current cursor address */
- X/* V_COL_FG -36 W Foreground color index */
- X/* V_COL_BG -38 W Background color index */
- X/* V_CEL_WR -40 W Offset to next vertical cell (bytes) */
- X/* V_CEL_MY -42 W Max cells high - 1 */
- X/* V_CEL_MX -44 W Max cells across - 1 */
- X/* V_CEL_HT -46 W Cell height in pixels (font form's height) */
- X/* --------------------------------------------------------------------------*/
- X
- X/*
- X * Atari finally named these variables
- X * so here they are
- X *
- X */
- Xtypedef struct {
- X WORD V_CEL_HT; /* *((WORD *)((char *)aline - (char *)46L)) */
- X WORD V_CEL_MX; /* *((WORD *)((char *)aline - (char *)44L)) */
- X WORD V_CEL_MY; /* *((WORD *)((char *)aline - (char *)42L)) */
- X WORD V_CEL_WR; /* *((WORD *)((char *)aline - (char *)40L)) */
- X WORD V_COL_BG; /* *((WORD *)((char *)aline - (char *)38L)) */
- X WORD V_COL_FG; /* *((WORD *)((char *)aline - (char *)36L)) */
- X char *V_CUR_AD; /* *((char **)((char **)aline - (char **)34L)) */
- X WORD V_CUR_OFF; /* *((WORD *)((char *)aline - (char *)30L)) */
- X WORD V_CUR_CX; /* *((WORD *)((char *)aline - (char *)28L)) */
- X WORD V_CUR_CY; /* *((WORD *)((char *)aline - (char *)26L)) */
- X WORD V_CUR_CNT; /* *((char *)((char *)aline - (char *)24L)) */
- X/* char V_CUR_TIM; *((char *)((char *)aline - (char *)23L)) */
- X char **V_FNT_AD; /* *((char **)((char **)aline - (char **)22L)) */
- X WORD V_FNT_ND; /* *((WORD *)((char *)aline - (char *)18L)) */
- X WORD V_FNT_ST; /* *((WORD *)((char *)aline - (char *)16L)) */
- X WORD V_FNT_WR; /* *((WORD *)((char *)aline - (char *)14L)) */
- X WORD V_X_MAX; /* *((WORD *)((char *)aline - (char *)12L)) */
- X char **V_OFF_AD; /* *((char **)((char **)aline - (char **)10L)) */
- X WORD V_STATUS; /* *((WORD *)((char *)aline - (char *) 6L)) */
- X WORD V_Y_MAX; /* *((WORD *)((char *)aline - (char *) 4L)) */
- X WORD xxdummy; /* *((WORD *)((char *)aline - (char *) 2L)) */
- X} NLINEA;
- X
- X /* A pointer to the type LINEA is returned by the Line A init call
- X * ($A000), in registers A0 and D0.
- X * This pointer is saved in the global variable 'aline'.
- X *
- X */
- Xtypedef struct {
- X
- X/* Type Name Offset Function Comments */
- X/* ------------------------------------------------------------------------- */
- X WORD VPLANES; /* 0 # of Planes Also see CurrRez */
- X WORD VWRAP; /* 2 Bytes / scan line " " " */
- X /* VWRAP can be changed to implement special effect*/
- X /* Doubling VWRAP will skip every other scan line */
- X /* */
- X /* */
- X WORD *CONTRL; /* 4 Ptr to CONTRL Array Contrl gets set to this */
- X WORD *INTIN; /* 8 Ptr to INTIN Array Intin gets set to this */
- X WORD *PTSIN; /* 12 Ptr to PTSIN Array Ptsin gets set to this */
- X WORD *INTOUT; /* 16 Ptr to INTOUT Array Intout gets set to this */
- X WORD *PTSOUT; /* 20 Ptr to PTSOUT Array Ptsout gets set to this */
- X /* CONTRL is the control array */
- X /* INTIN is the array of input parameters */
- X /* PTSIN is the array of input coordinates */
- X /* Even entrys are X coordinate */
- X /* Odd entrys are corresponding Y coodinates */
- X /* INTOUT is the array of output parameters */
- X /* PTSOUT is the array of output coordinates */
- X /* organizes like PTSIN. */
- X /* */
- X WORD COLBIT0; /* 24 Plane 0 Color Value All Three Rez's */
- X WORD COLBIT1; /* 26 Plane 1 Color Value Med and Low Rez only */
- X WORD COLBIT2; /* 28 Plane 2 Color Value Low Rez only */
- X WORD COLBIT3; /* 30 Plane 3 Color Value Low Rez Only */
- X /* Foreground color COLBIT0 + 2*COLBIT1 + 4*COLBIT2*/
- X /* + 8*COLBIT3 */
- X /* */
- X /* */
- X WORD LSTLIN; /* 32 Always set to -1, Done for you in init_aline() */
- X /* Does anyone know what it is supposed to be? */
- X /* */
- X WORD LNMASK; /* 34 Linemask used when drawing lines, same as Vdi's */
- X /* line style */
- X /* */
- X WORD WMODE; /* 36 Writing mode */
- X /* 0=Replace Mode-Replace all bits in Dest with src*/
- X /* 1=Trans. Mode-Only additional bits in src set(OR*/
- X /* 2=Xor Mode- Src XOR Dest */
- X /* 3=Inverse Trans.- (NOT src) Or Dest */
- X /* Values upto 16 are permitted */
- X /* */
- X WORD X1; /* 38 X1 coordinate used in various calls */
- X /* */
- X WORD Y1; /* 40 Y1 coordinate used in various calls */
- X /* */
- X WORD X2; /* 42 X2 coordinate used in various calls */
- X /* */
- X WORD Y2; /* 44 Y2 coordinate used in various calls */
- X /* */
- X /* */
- X WORD *PATPTR; /* 46 Pointer to current fill pattern */
- X /* Must be integral power of 2 (words) in length */
- X WORD PATMSK; /* 50 I don't know why they call it a mask. It is in */
- X /* reality the length in words of the current patt.*/
- X WORD MFILL; /* 52 Multi Plane fill flag 1 == Current fill Pattern */
- X /* is for Muti Plane. */
- X /* */
- X /* */
- X WORD CLIP; /* 54 Clipping Flag 1 == TRUE */
- X WORD XMINCL; /* 56 Min X of clipping window */
- X WORD YMINCL; /* 58 Min Y of clipping window */
- X WORD XMAXCL; /* 60 Max X of clipping window */
- X WORD YMAXCL; /* 62 Max Y of clipping window */
- X /* */
- X /* */
- X WORD XDDA; /* 64 Accumulator for Scaling, Must be set to 0x08000 */
- X /* before each call to Text Blt. Done for you in */
- X /* in aline_text() */
- X WORD DDAINC; /* 66 Scaling factor - Fractional amount to scale char*/
- X /* When scaling up = 256 *(Size-Textsize)/Textsize */
- X /* When scaling down = 256*(Size)/Textsize */
- X /* scaling down does not work */
- X WORD SCALDIR; /* 68 Scaling direction 0 == down */
- X WORD MONO; /* 70 Mono flag 0== current font is a propotional font*/
- X /* Its Ok for Thickening to increase the width of */
- X /* the current character. */
- X /* 1 == current font is mono spaced, so thickening */
- X /* may not increase the width of the current char */
- X /* */
- X WORD SOURCEX; /* 72 X coordinate of character in the font form */
- X /* SOURCEX is caluclated from info in the font */
- X /* header for the current font (see FONT type) */
- X /* SOURCEX = off_table[char-first_ade] */
- X /* SOURCEX is calculated for you in aline_text() */
- X /* The pointer to a table of font header for the */
- X /* internal fonts is returned in A2 on init (A000) */
- X WORD SOURCEY; /* 74 Y coodinate of character in the font form */
- X /* Typically set to 0 (top line of font form) */
- X WORD DESTX; /* 76 X coordinate of character on screen */
- X WORD DESTY; /* 78 Y coordinate of character on screen */
- X WORD DELX; /* 80 Width of Character */
- X /* Difference between two SOURCEX's */
- X WORD DELY; /* 82 Height of Character */
- X /* form_height field of FONT_HEAD of current font */
- X WORD *FBASE; /* 84 Pointer to start of font form */
- X WORD FWIDTH; /* 88 Width of the current font's form */
- X /* */
- X WORD STYLE; /* 90 Vector of style flags */
- X /* Bit 0 = Thicken Flag */
- X /* Bit 1 = Lighten Flag */
- X /* Bit 2 = Skewing Flag */
- X /* Bit 3 = Underline Flag (ignored) */
- X /* Bit 4 = Outline Flag */
- X /* */
- X WORD LITEMASK; /* 92 Mask used for lightening text */
- X /* The Mask is picked up from the font header */
- X WORD SKEWMASK; /* 94 Mask used for skewing text */
- X /* The Mask is picked up from the font header */
- X WORD WEIGHT; /* 96 The number of bits by which to thicken text */
- X /* The number is picked up from the font header */
- X WORD ROFF; /* 98 Offset above baseline when skewing */
- X /* Again picked up from the font header */
- X /* */
- X WORD LOFF; /* 100 Offset below character baseline when skewing */
- X /* Again picked up from the font header */
- X /* */
- X WORD SCALE; /* 102 Scaling Flag 1 == true */
- X /* */
- X WORD CHUP; /* 104 Character rotation vector. */
- X /* 0 = normal (0 degrees) */
- X /* 1800 = 180 degrees */
- X /* 2700 = 270 degrees */
- X /* */
- X WORD TEXTFG; /* 106 Text foreground color */
- X /* */
- X char *SCRTCHP; /* 108 Address of buffer required for creating special */
- X /* text effects. The size of this buffer should be */
- X /* 1K according the Internals. The Atari document */
- X /* of course does not talk about such things :-) */
- X /* */
- X WORD SCRPT2; /* 112 The offset of the scaling buffer buffer in above*/
- X /* buffer. Internals suggests an offset of 0x0040 */
- X /* As usual the Atari document does'nt say a thing */
- X /* */
- X WORD TEXTBG; /* 114 Text background color (Ram Vdi only) */
- X /* used for the BitBlt writing modes (4-19) only */
- X /* */
- X WORD COPYTRAN; /* 116 Copy raster form type flag (Ram vdi only) */
- X /* 0 => Opaque type */
- X /* n-plane source -> n-plane dest */
- X /* BitBlt writing modes (4-19) */
- X /* ~0 => Transparent type */
- X /* 1-plane source -> n-plane dest */
- X /* Vdi writing modes (1-3) */
- X /* */
- X WORD(*SEEDABORT)();/* 118 Pointer to function returning int, which is */
- X /* called by the fill logic to allow the fill to */
- X /* be aborted. If the routine returns FALSE (0) */
- X /* the fill is not aborted. If it returns TRUE (~0)*/
- X /* the fill is aborted */
- X/* ------------------------------------------------------------------------- */
- X
- X} LINEA; /* P H E W !!!!! */
- X
- X
- X
- X /* A pointer to array of type FONT is returned by the Line A init call
- X * ($A000), in regsister A1.
- X * This pointer is saved in the global array variable 'fonts[]'.
- X *
- X */
- X
- Xtypedef struct _font {
- X
- X/* Type Name Offset Function Comments */
- X/* ------------------------------------------------------------------------- */
- X WORD font_id; /* 0 Font face identifier 1 == system font */
- X /* */
- X WORD size; /* 2 Font size in points */
- X /* */
- X char name[32]; /* 4 Face name */
- X /* */
- X WORD first_ade; /* 36 Lowest ADE value in the face (lowest ASCII value */
- X /* of displayable character). */
- X /* */
- X WORD last_ade; /* 38 Highest ADE value in the face (highest ASCII valu*/
- X /* of displayable character). */
- X /* */
- X WORD top; /* 40 Distance of top line relative to baseline */
- X /* */
- X WORD ascent; /* 42 Distance of ascent line relative to baseline */
- X /* */
- X WORD half; /* 44 Distance of half line relative to baseline */
- X /* */
- X WORD descent; /* 46 Distance of decent line relative to baseline */
- X /* */
- X WORD bottom; /* 48 Distance of bottom line relative to baseline */
- X /* All distances are measured in absolute values */
- X /* rather than as offsets. They are always +ve */
- X /* */
- X WORD max_char_width; /* 50 Width of the widest character in font */
- X /* */
- X WORD max_cell_width; /* 52 Width of the widest cell character cell in face */
- X /* */
- X WORD left_offset; /* 54 Left Offset see Vdi appendix G */
- X /* */
- X WORD right_offset; /* 56 Right offset " " " */
- X /* */
- X WORD thicken; /* 58 Number of pixels by which to thicken characters */
- X /* */
- X WORD ul_size; /* 60 Width in pixels of the underline */
- X /* */
- X WORD lighten; /* 62 The mask used to lighten characters */
- X /* */
- X WORD skew; /* 64 The mask used to determine when to perform */
- X /* additional rotation on the character to perform */
- X /* skewing */
- X /* */
- X WORD flags; /* 66 Flags */
- X /* bit 0 set if default system font */
- X /* bit 1 set if horiz offset table should be used */
- X /* bit 2 byte-swap flag (thanks to Intel idiots) */
- X /* bit 3 set if mono spaced font */
- X /* */
- X char *h_table; /* 68 Pointer to horizontal offset table */
- X /* */
- X WORD *off_table; /* 72 Pointer to character offset table */
- X /* */
- X char *dat_table; /* 76 Pointer to font data */
- X /* */
- X WORD form_width; /* 80 Form width (#of bytes /scanline in font data) */
- X /* */
- X WORD form_height;/* 82 Form height (#of scanlines in font data) */
- X /* */
- X struct _font *next_font; /* 84 Pointer to next font in face */
- X /* */
- X/* ------------------------------------------------------------------------- */
- X} FONT;
- X
- X
- X /*
- X * OP_TAB type required for Bit Blt parameter block.
- X * each entry defines the logic operation to apply for
- X * the 4 Fore/Back ground bit combinations
- X */
- Xtypedef struct {
- X
- X/* Type Name Offset Function Comments */
- X/* ------------------------------------------------------------------------- */
- X char fg0bg0; /* 0 Logic op to employ when both FG and BG are 0 */
- X char fg0bg1; /* 1 Logic op to employ when FG = 0 and BG = 1 */
- X char fg1bg0; /* 2 Logic op to employ when FG = 1 and BG = 0 */
- X char fg1bg1; /* 3 Logic op to employ when both FG and BG are 1 */
- X/* ------------------------------------------------------------------------- */
- X} OP_TAB;
- X
- X
- X/*
- X * Source and destination description blocks
- X */
- Xtypedef struct {
- X WORD bl_xmin; /* Minimum x */
- X WORD bl_ymin; /* Minimum y */
- X char *bl_form; /* Word aligned memory form */
- X WORD bl_nxwd; /* Offset to next word in line */
- X WORD bl_nxln; /* Offset to next line in plane */
- X WORD bl_nxpl; /* Offset to next plane */
- X}SDDB;
- X
- X /* Offsets to next word in plane */
- X#define HI_NXWD 2
- X#define MED_NXWD 4
- X#define LOW_NXWD 8
- X
- X /* Scan line widths of the screen */
- X#define HI_NXLN 80
- X#define MED_NXLN 160
- X#define LOW_NXLN 160
- X
- X /*
- X * Offsets between planes - always the same due to
- X * the way the STs video memory is laid out
- X */
- X#define NXPL 2
- X
- X /*
- X * Bit Blt Parameter Block Type (for function $A007)
- X *
- X */
- X
- Xtypedef struct {
- X
- X/* Type Name Offset Function Comments */
- X/* ------------------------------------------------------------------------- */
- X WORD bb_b_wd; /* width of block in pixels */
- X WORD bb_b_ht; /* height of block in pixels */
- X WORD bb_plane_ct; /* number of planes to blit */
- X WORD bb_fg_col; /* foreground color */
- X WORD bb_bg_col; /* back ground color */
- X OP_TAB bb_op_tab; /* logic for fg x bg combination */
- X SDDB bb_s; /* source info block */
- X SDDB bb_d; /* destination info block */
- X WORD *bb_p_addr; /* pattern buffer address */
- X WORD bb_p_nxln; /* offset to next line in pattern */
- X WORD bb_p_nxpl; /* offset to next plane in pattern */
- X WORD bb_p_mask; /* pattern index mask */
- X char bb_fill[24]; /* work space */
- X/* ------------------------------------------------------------------------- */
- X} BBPB;
- X
- X
- X/*
- X * Memory Form Definition Block
- X *
- X */
- Xtypedef struct
- X{
- X char *fd_addr; /* Addrerss of upper left corner of firs*/
- X /* plane of raster area. If NULL then */
- X /* MFDB is for a physical device */
- X WORD fd_w; /* Form Width in Pixels */
- X WORD fd_h; /* Form Height in Pixels */
- X WORD fd_wdwidth; /* Form Width in words (fd_w/sizeof(int)*/
- X WORD fd_stand; /* Form format 0= device spec 1=standard*/
- X WORD fd_nplanes; /* Number of memory planes */
- X WORD fd_r1; /* Reserved */
- X WORD fd_r2; /* Reserved */
- X WORD fd_r3; /* Reserved */
- X} MFDB;
- X
- X
- X
- X
- X/*
- X * Sprite definition block
- X *
- X */
- Xtypedef struct
- X{
- X WORD sp_xhot; /* Offset to X hot spot */
- X WORD sp_yhot; /* Offset to Y hot spot */
- X WORD sp_format; /* Format SP_VDI or SP_XOR */
- X WORD sp_bg; /* Background color */
- X WORD sp_fg; /* Foregroud color */
- X WORD sp_data[32]; /* Sprite data - */
- X /* Alternating words of back/fore */
- X /* ground data */
- X /* Note that: */
- X /* sprite save block is */
- X /* 10+VPLANES*64 bytes long */
- X
- X} SFORM;
- FRIDAY_NIGHT
- echo mes.14 completed!
- # That's all folks!
-
-
-