Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ibmpa!dolphin.tcspa.ibm.com!mlewis From: mlewis@dolphin.tcspa.ibm.com (Mark S. Lewis) Newsgroups: comp.sys.ibm.pc.rt Subject: IBM 8514 source code (part 4 of 6) for X11 Release 4 Keywords: V1.32_kit.4 8514 X11R4 Message-ID: <4474@ibmpa.UUCP> Date: 12 Mar 90 23:20:09 GMT Sender: news@ibmpa.UUCP Reply-To: mlewis@ibmsupt.UUCP Followup-To: comp.sys.ibm.pc.rt Organization: IBM AWD, Palo Alto Lines: 2541 Subject: IBM 8514 source code (part 4 of 6) for X11 Release 4 Index: ../mit/server/ddx/ibm/ibm8514 Description: IBM has decided to provide X11 source code for the 8514 display adapter. This is the same code used to build the object files included in the X11 Release 4 distribution. This code supports servers for both AIX and IBM/4.3 on their respective platforms. V1.32_kit.1 59,103 Bytes V1.32_kit.2 61,796 Bytes V1.32_kit.3 60,982 Bytes V1.32_kit.4 62,729 Bytes V1.32_kit.5 54,871 Bytes V1.32_kit.6 29,170 Bytes Installation: This code is provided in a 6-part shell archive. Before you install it, you should save your current code. You should save the Imakefile in the ibm server directory. You also should save the entire ibm8514 directory by moving and remaking it. cd ../mit/server/ddx/ibm cp Imakefile Imakefile.orig mv ibm8514 ibm8514.orig mkdir ibm8514 Next, edit this header from each part, and feed the rest to /bin/sh. Proceed to make the server as instructed in the X11 release notes. sh < V1.32_kit.4 =====----- Mark S. Lewis, IBM AWD Palo Alto -----====== inet: mlewis%ibmsupt@uunet.uu.net (415) 855-4486 uucp: uunet!ibmsupt!mlewis IBM Tie Line: 465-4486 # 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. # # # ibm8514/brcImg.c # ibm8514/brcLine.c # ibm8514/brcMono.c # ibm8514/brcOSD.c # ibm8514/brcOutL.c # ibm8514/brcPgon.c # ibm8514/brcPoly.c # ibm8514/brcProcs.h # ibm8514/brcPushPxl.c # echo x - ibm8514/brcImg.c sed 's/^X//' >ibm8514/brcImg.c << 'END-of-ibm8514/brcImg.c' X/* X * Copyright IBM Corporation 1987,1990 X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of IBM not be X * used in advertising or publicity pertaining to distribution of the X * software without specific, written prior permission. X * X * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL X * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS X * SOFTWARE. X * X*/ X/* X * PRPQ 5799-PFF (C) COPYRIGHT IBM CORPORATION 1987,1990 X * LICENSED MATERIALS - PROPERTY OF IBM X * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083 X */ X/* X * Hardware interface routines for IBM 8514/A adapter for X * X.11 server(s) on IBM equipment. X * X */ X X/* $Header: /andrew/X11/r3src/release/server/ddx/ibm/ibm8514/RCS/brcImg.c,v 30.1 89/04/29 21:59:24 jeff Exp $ */ X/* $Source: /andrew/X11/r3src/release/server/ddx/ibm/ibm8514/RCS/brcImg.c,v $ */ X X#ifndef lint Xstatic char *rcsid = "$Header: /andrew/X11/r3src/release/server/ddx/ibm/ibm8514/RCS/brcImg.c,v 30.1 89/04/29 21:59:24 jeff Exp $" ; X#endif X X/* IMAGES X * Read and Write Full Color Images to/from 8514/A X * X */ X#include "X.h" X X#include "servermd.h" X X#include "OScompiler.h" X X#include "x8514.h" X X#include "ibmTrace.h" X Xextern int mergexlate[16] ; Xextern int ibm8514cursorSemaphore ; X Xextern void blockoutw() ; Xextern void blockinw() ; X Xvoid Xibm8514DrawColorImage( x, y, w, h, data, RowIncrement, merge, planes ) Xint x,y ; Xregister int w ; Xint h ; Xregister unsigned char *data ; Xint RowIncrement ; Xint merge ; Xunsigned long int planes ; X{ Xint saved ; X XTRACE( ( "ibm8514DrawColorImage(x=%d,y=%d,w=%d,h=%d,data=x%x,RowIncrement=%d,merg e=x%x,planes=x%x)\n", X x, y, w, h, data, RowIncrement, merge, planes ) ) ; X Xif ( ( w <= 0 ) || ( h <= 0 ) ) X return ; X Xsaved = !ibm8514cursorSemaphore && ibm8514CheckCursor( x, y, w, h ) ; X Xibm8514ATRNotBusy ; Xibm8514ClearQueue( 7 ) ; XPLNWENBL( planes ) ; XSETFN1( FNVAR, mergexlate[ merge ] ) ; /* don't overlook that FNVAR */ XSETX0( x ) ; XSETY0( y ) ; XSETLX( w - 1 ) ; XSETLY( h - 1 ) ; X XCOMMAND( ibm8514WriteZData ) ; X X/* NOTE: we write half as many shorts as bytes */ Xif ( w == RowIncrement ) X blockoutw( data, ( ( w * h ) + 1 ) >> 1 ) ; Xelse if ( w & 1 ) { /* MOD 2 == 1 */ X int extrah ; X unsigned char tchar ; X int almostw ; X X extrah = h & 1 ; X h >>= 1 ; /* write half line pairs */ X if ( almostw = --w >> 1 ) { X while ( h-- ) { /* write half line pairs */ X /* WARNING: arg to blockoutw may not be 16-bit aligned here ! */ X blockoutw( data, almostw ) ; X tchar = data[ w ] ; X data += RowIncrement ; X#if IMAGE_BYTE_ORDER == MSBFirst X outw( VARDATA, ( tchar << 8 ) | *data ) ; X#else X outw( VARDATA, tchar | ( ( *data ) << 8 ) ) ; X#endif X /* WARNING: arg to blockoutw may not be 16-bit aligned here ! */ X blockoutw( data + 1, almostw ) ; X data += RowIncrement ; X } X /* WARNING: arg to blockoutw may not be 16-bit aligned here ! */ X if ( extrah ) X blockoutw( data, almostw + 1 ) ; X } X else { X while ( h-- ) { /* write half line pairs */ X tchar = data[ w ] ; X data += RowIncrement ; X#if IMAGE_BYTE_ORDER == MSBFirst X outw( VARDATA, ( tchar << 8 ) | *data ) ; X#else X outw( VARDATA, tchar | ( ( *data ) << 8 ) ) ; X#endif X data += RowIncrement ; X } X /* WARNING: arg to blockoutw may not be 16-bit aligned here ! */ X if ( extrah ) X#if IMAGE_BYTE_ORDER == MSBFirst X outw( VARDATA, ( *data << 8 ) ) ; X#else X outw( VARDATA, *data ) ; X#endif X } X} Xelse X for ( w >>= 1 ; h-- ; data += RowIncrement ) X blockoutw( data, w ) ; X Xibm8514ClearQueue( 3 ) ; /* following a blockout */ XSETFN1( FNCOLOR1, FNREPLACE ) ; XPLNWENBL( ibm8514ALLPLANES ) ; X Xif ( saved ) X ibm8514ReplaceCursor() ; X Xreturn ; X} X Xvoid Xibm8514ReadColorImage( x, y, lx, ly, data, RowIncrement ) Xint x ; Xint y ; Xint lx ; Xint ly ; Xregister unsigned char *data ; Xint RowIncrement ; X{ Xint saved ; X XTRACE( ( "ibm8514ReadColorImage(x=%d,y=%d,lx=%d,ly=%d,data=x%x,RowIncrement=%d)\n", X x, y, lx, ly, data, RowIncrement ) ) ; X Xif ( ( lx <= 0 ) || ( ly <= 0 ) ) X return ; X Xsaved = !ibm8514cursorSemaphore && ibm8514CheckCursor( x, y, lx, ly ) ; X Xibm8514ATRNotBusy ; Xibm8514CheckQueue( 4 ) ; XPLNWENBL( ibm8514ALLPLANES ) ; XPLNRENBL( ibm8514ALLPLANES ) ; XSETMODE( M_DEPTH ) ; XSETFN1( FNVAR, FNREPLACE ) ; Xibm8514CheckQueue( 5 ) ; XSETX0( x ) ; XSETY0( y ) ; XSETLX( lx - 1 ) ; XSETLY( ly - 1 ) ; XCOMMAND( ibm8514ReadZData ) ; X Xif ( lx == RowIncrement ) X blockinw( data, ( lx * ly ) / 2 ) ; X/* NOTE: we read half as many shorts as bytes */ Xelse if ( lx & 1 ) { /* MOD 2 == 1 */ X unsigned short int shrt ; X int extrah ; X int almostw ; X X almostw = --lx >> 1 ; X extrah = ly & 1 ; X ly >>= 1 ; X while ( ly-- ) { /* write half line pairs */ X blockinw( data, almostw ) ; X shrt = inw( VARDATA ) ; X#if IMAGE_BYTE_ORDER == MSBFirst X data[ lx ] = shrt >> 8 ; /* Top 8 bits */ X data += RowIncrement ; X *data = shrt & 0xFF ; /* Bottom 8 bits */ X#else X data[ lx ] = shrt & 0xFF ; /* Bottom 8 bits */ X data += RowIncrement ; X *data = shrt >> 8 ; /* Top 8 bits */ X#endif X /* WARNING: arg to blockinw may not be 16-bit aligned here ! */ X blockinw( data + 1, almostw ) ; X data += RowIncrement ; X } X if ( extrah ) { X blockinw( data, almostw ) ; X shrt = inw( VARDATA ) ; X#if IMAGE_BYTE_ORDER == MSBFirst X data[ lx ] = shrt >> 8 ; /* Top 8 bits */ X#else X data[ lx ] = shrt & 0xFF ; /* Bottom 8 bits */ X#endif X } X} Xelse X for ( lx >>= 1 ; ly-- ; data += RowIncrement ) X blockinw( data, lx ) ; X Xibm8514ClearQueue( 2 ) ; XSETFN1( FNCOLOR1, FNREPLACE ) ; XSETMODE( M_ONES ) ; X Xif ( saved ) X ibm8514ReplaceCursor() ; X Xreturn ; X} END-of-ibm8514/brcImg.c echo x - ibm8514/brcLine.c sed 's/^X//' >ibm8514/brcLine.c << 'END-of-ibm8514/brcLine.c' X/* X * Copyright IBM Corporation 1987,1990 X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of IBM not be X * used in advertising or publicity pertaining to distribution of the X * software without specific, written prior permission. X * X * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL X * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS X * SOFTWARE. X * X*/ X/* X * PRPQ 5799-PFF (C) COPYRIGHT IBM CORPORATION 1987,1990 X * LICENSED MATERIALS - PROPERTY OF IBM X * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083 X */ X/* X * Hardware interface routines for IBM 8514/A adapter for X * X.11 server(s) on IBM equipment. X * X */ X X/* $Header: /andrew/X11/r3src/r3plus/server/ddx/ibm/ibm8514/RCS/brcLine.c,v 6.4 89/05/07 15:13:06 paul Exp $ */ X/* $Source: /andrew/X11/r3src/r3plus/server/ddx/ibm/ibm8514/RCS/brcLine.c,v $ */ X X#ifndef lint Xstatic char *rcsid = "$Header: /andrew/X11/r3src/r3plus/server/ddx/ibm/ibm8514/RCS/brcLine.c,v 6.4 89/05/07 15:13:06 paul Exp $" ; X#endif X X#include "X.h" X#include "misc.h" X#include "colormapst.h" X#include "pixmapstr.h" X X#include "ppc.h" X X#include "x8514.h" X X#include "ibmTrace.h" X X#define X_AXIS 0 X Xextern int mergexlate[] ; Xextern int ibm8514cursorSemaphore ; X Xvoid Xibm8514HorzLine( color, alu, mask,x,y,w) Xunsigned long int color ; Xint alu ; Xunsigned long int mask ; Xint x,y,w ; X{ Xint saved ; X Xif (w<=0) X return ; Xsaved = !ibm8514cursorSemaphore && ibm8514CheckCursor( x, y, w, 1) ; X Xibm8514ClearQueue(7) ; XPLNWENBL(mask) ; XSETCOL1(color) ; XSETFN1(FNCOLOR1,mergexlate[alu]) ; XSETLX(w) ; XSETX0(x) ; XSETY0(y) ; XCOMMAND(0x201f) ; X X Xibm8514CheckQueue(2) ; XSETFN1(FNCOLOR1,FNREPLACE) ; XPLNWENBL( ibm8514ALLPLANES ) ; X Xif (saved) X ibm8514ReplaceCursor() ; Xreturn ; X} X Xvoid Xibm8514VertLine( color, alu, mask,x,y,h) Xunsigned long int color ; Xint alu ; Xunsigned long int mask ; Xint x,y,h ; X{ Xint saved ; X Xif ( h <= 0 ) X return ; Xsaved = !ibm8514cursorSemaphore && ibm8514CheckCursor(x, y, 1, h) ; X Xibm8514ClearQueue(7) ; XPLNWENBL(mask) ; XSETCOL1(color) ; XSETFN1(FNCOLOR1,mergexlate[alu]) ; XSETLX(h) ; XSETX0(x) ; XSETY0(y) ; XCOMMAND(0x20df) ; X Xibm8514ClearQueue(2) ; XSETFN1(FNCOLOR1,FNREPLACE) ; XPLNWENBL( ibm8514ALLPLANES ) ; X Xif (saved) X ibm8514ReplaceCursor() ; Xreturn ; X} X Xvoid Xibm8514BresLine( color, alu, mask, signdx, signdy, axis, x, y, et, e1, e2, len) Xunsigned long int color ; Xint alu ; Xunsigned long int mask ; Xint signdx, signdy, axis, x, y, et, e1, e2, len ; X{ Xunsigned short command ; Xint saved ; Xint cx, cy ; X Xif ( len <= 0 ) X return ; Xif (signdx == -1) X cx = x - len ; Xelse X cx = x ; Xif (signdy == -1) X cy = y - len ; Xelse X cy = y ; Xsaved = !ibm8514cursorSemaphore && ibm8514CheckCursor( cx,cy,len,len ) ; X Xif (axis==X_AXIS) X command = 0x2017 ; /* draw bres. line on X, W, LPN, */ Xelse X command = 0x2057 ; /* same, on Y */ Xif (signdx > 0) X command |= 0x0020 ; Xif (signdy > 0) X command |= 0x0080 ; X Xibm8514ATRNotBusy ; Xibm8514CheckQueue( 5 ) ; XPLNWENBL(mask) ; XSETET(et) ; XSETK1(e1) ; XSETK2(e2) ; XSETFN1(FNCOLOR1,mergexlate[alu]) ; X Xibm8514CheckQueue( 5 ) ; XSETCOL1(color) ; XSETLX(len) ; /* going to use LAST PEL NULL in Line command to brecon */ XSETX0(x) ; XSETY0(y) ; XCOMMAND(command) ; X Xibm8514ClearQueue(2) ; XSETFN1( FNCOLOR1, FNREPLACE ) ; XPLNWENBL( ibm8514ALLPLANES ) ; X Xif (saved) X ibm8514ReplaceCursor() ; Xreturn ; X} END-of-ibm8514/brcLine.c echo x - ibm8514/brcMono.c sed 's/^X//' >ibm8514/brcMono.c << 'END-of-ibm8514/brcMono.c' X/* X * Copyright IBM Corporation 1987,1990 X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of IBM not be X * used in advertising or publicity pertaining to distribution of the X * software without specific, written prior permission. X * X * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL X * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS X * SOFTWARE. X * X*/ X/* X * PRPQ 5799-PFF (C) COPYRIGHT IBM CORPORATION 1987,1990 X * LICENSED MATERIALS - PROPERTY OF IBM X * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083 X */ X/* X * Hardware interface routines for IBM 8514/A adapter for X * X.11 server( s ) on IBM equipment. X * X */ X/* $Header: /andrew/X11/r3src/release/server/ddx/ibm/ibm8514/RCS/brcMono.c,v 30.0 89/01/23 19:23:54 paul Exp $ */ X/* $Source: /andrew/X11/r3src/release/server/ddx/ibm/ibm8514/RCS/brcMono.c,v $ */ X X#ifndef lint Xstatic char *rcsid = "$Header: /andrew/X11/r3src/release/server/ddx/ibm/ibm8514/RCS/brcMono.c,v 30.0 89/01/23 19:23:54 paul Exp $" ; X#endif X X/* MONO- X This file is here to do the sundry Monochrome ops on the 8514. You X may wish to read or write a plane or take a depth - 1 image and use X it to fill Foreground and Background. X X Monochrome ops to the 8514 are a bear ( in terms of cycles ) when the X target is not a 4-ple, so these routines plan on you drawing to a 4-ple X target ( off-screen if necessary ) and blitting to the final destination X if necessary. X*/ X X#include "X.h" X#include "Xmd.h" X#include "os.h" X X#include "OScompiler.h" X X#include "x8514.h" X X#include "ibmTrace.h" X Xextern int mergexlate[] ; Xextern int ibm8514cursorSemaphore ; X X/* I/O port type is 4 bytes for 6152 but only 2 for i386 !! */ X#if defined(ATRIO) X/* X * Transmogrify: To change or alter greatly and often with X * grotesque or humorous effect. X * ( Websters Ninth New Collegiate Dictionary ) X */ X#define transmogrify( byte ) \ X( ( ( byte | ( ( ( unsigned short int ) byte ) << 4 ) ) & ~ 0xF0 ) << 1 ) X Xstatic void Xblockouttransmogrifiedw( values, n ) Xregister unsigned char *values ; Xregister int n ; X{ Xregister unsigned char tmp ; Xregister volatile unsigned long int * const ptr = X (volatile unsigned long int *) ( VARDATA | WORDADD ) ; X Xwhile ( n-- ) { X tmp = *values++ ; X *ptr = (unsigned long int) transmogrify( tmp ) ; X} Xreturn ; X} X#else /* Not "ATRIO" */ X#if defined(PCIO ) X#if !defined(USE_PORTABLE_BLOCKOUTTRANSMOGRIFIEDW) Xextern void blockouttransmogrifiedw() ; X#else /* Not "PCIO" either */ X#define transmogrify( byte ) \ X( ( ( byte >> 3 ) | ( ( (unsigned short int) byte ) << 9 ) ) & 0x1E1E ) X Xstatic void Xblockouttransmogrifiedw( values, n ) Xregister unsigned char *values ; Xregister int n ; X{ Xregister unsigned char tmp ; X Xwhile ( n-- ) { X tmp = *values++ ; X /* XXX make this smarter if we can */ X ibm8514CheckQueue( 1 ) ; X outw( VARDATA, transmogrify( tmp ) ) ; X} Xreturn ; X} X#endif /* USE_PORTABLE_BLOCKOUTTRANSMOGRIFIEDW */ X#else /* Not "PCIO" */ X ******** ERROR ******** X#endif /* Not "PCIO" */ X#endif /* Not "ATRIO" */ X X/* Used by cursor & FillSpans */ Xvoid Xibm8514AlignMonoImage( planes, merge, x, y, lx, ly, data ) Xunsigned long int planes ; Xint merge ; Xregister int x, y, lx, ly ; Xregister unsigned char *data ; X{ X/*WARNING WARNING WARNING this routine merges 1's to requested planes and 0's X* ro requested planes, BUT ALIGNS X TO BE A MULTIPLE OF FOUR!!! X* X* Use ibm8514StageMono and Blit to get monochrome images elsewhere X*/ X register int width ; X int CursorIsSaved ; X XTRACE(("ibm8514AlignMonoImage(planes=x%x,merge=x%x,x=x%x,y=x%x,lx=x%x,l y=x%x,data=x%x)\n", X planes, merge, x, y, lx, ly, data ) ) ; X X if ( ( lx <= 0 ) || ( ly <= 0 ) ) X return ; X X CursorIsSaved = !ibm8514cursorSemaphore X && ibm8514CheckCursor( x, y, lx, ly ) ; X X ibm8514ATRNotBusy ; X ibm8514CheckQueue( 4 ) ; X PLNWENBL( planes ) ; X SETMODE( M_VAR ) ; X SETFN0( FNCOLOR0, mergexlate[merge] ) ; X SETFN1( FNCOLOR1, mergexlate[merge] ) ; X x &= ~ 03 ; /* alignment happens here */ X ibm8514CheckQueue( 4 ) ; X SETX0( x ) ; X SETY0( y ) ; X /* measured in BITS - clip will discard excess */ X width = ( lx + 0x1F ) >> 5 ; X SETLX( ( width << 5 ) - 1 ) ; X SETLY( ly - 1 ) ; X X ibm8514CheckQueue( 4 ) ; X SETCOL1( 255 ) ; X SETCOL0( 0 ) ; X SETXMAX( x + lx - 1 ) ; X COMMAND( ibm8514WriteXYData ) ; X blockouttransmogrifiedw( data, width * ly * 4 ) ; X X ibm8514ClearQueue( 5 ) ; X SETMODE( M_ONES ) ; X SETFN1( FNCOLOR1, FNREPLACE ) ; X SETFN0( FNCOLOR0, FNREPLACE ) ; X PLNWENBL( ibm8514ALLPLANES ) ; X SETXMAX( _8514_SCREEN_WIDTH - 1 ) ; X X if ( CursorIsSaved ) X ibm8514ReplaceCursor() ; X return ; X} X X/* Used By Stipple */ Xvoid Xibm8514StageMono( lx, ly, data ) Xregister int lx, ly ; Xregister unsigned char *data ; X{ XTRACE(("ibm8514StageMono(lx=x%x,ly=x%x,data=x%x)\n",lx,ly,data)); X Xif ( ( lx <= 0 ) || ( ly <= 0 ) ) X return ; Xibm8514AlignMonoImage( MONO_STAGE_WPLANE, GXcopy, MONO_STAGE_X, MONO_STAGE_Y, X lx, ly, data ) ; Xreturn ; X} X X/* Not Used ??? */ Xvoid Xibm8514FillMonoImage( planes, fg, bg, merge, x, y, lx, ly, data ) Xunsigned long int planes, fg, bg ; Xint merge, x ; Xregister int y ; Xint lx ; Xregister int ly ; Xregister unsigned char *data ; X{ Xregister int count ; Xint blocksize, CursorIsSaved ; X XTRACE(("ibm8514FillMonoImage(planes=x%x,fg=x%x,bg=x%x,merge=x%x,x=x%x,y =x%x,lx=x%x,ly=x%x,data=x%x)\n", X planes, fg, bg, merge, x, y, lx, ly, data ) ) ; X Xif ( ( lx <= 0 ) || ( ly <= 0 ) ) X return ; X XCursorIsSaved = !ibm8514cursorSemaphore && ibm8514CheckCursor( x, y, lx, ly ) ; Xibm8514cursorSemaphore++ ; X Xblocksize = ( lx + 3 ) * MONO_STAGE_SIZE ; Xcount = ( ( ly + MONO_STAGE_SIZE - 1 ) / MONO_STAGE_SIZE ) - 1 ; Xwhile ( count-- ) { X ibm8514StageMono( lx, MONO_STAGE_SIZE, data ) ; X ibm8514BlitFGBG( MONO_STAGE_RPLANE, planes, fg, bg, merge, X MONO_STAGE_X, MONO_STAGE_Y, X x, y, lx, MONO_STAGE_SIZE ) ; X data += blocksize ; X y += MONO_STAGE_SIZE ; X ly -= MONO_STAGE_SIZE ; X} Xif ( ly ) { X ibm8514StageMono( lx, ly, data ) ; X ibm8514BlitFGBG( MONO_STAGE_RPLANE, planes, fg, bg, merge, X MONO_STAGE_X, MONO_STAGE_Y, X x, y, lx, ly ) ; X} Xif ( !--ibm8514cursorSemaphore && CursorIsSaved ) X ibm8514ReplaceCursor() ; Xreturn ; X} X X/* Not Used ?? */ Xvoid Xibm8514DrawMonoByteImage( data, x, y, lx, ly, fg, merge, planes ) Xregister unsigned char *data ; Xunsigned long int fg ; Xint x, y, lx, ly ; Xint merge ; Xunsigned long int planes ; X{ X/*WARNING WARNING WARNING this routine merges 1's to requested planes and 0's X* ro requested planes, BUT ALIGNS X TO BE A MULTIPLE OF FOUR!!! X* X* Use ibm8514StageMono and Blit to get monochrome images elsewhere X*/ X register int width ; X int CursorIsSaved ; X XTRACE(("ibm8514DrawMonoImage(planes=x%x,merge=x%x,x=x%x,y=x%x,lx=x%x,ly =x%x,data=x%x)\n", X planes, merge, x, y, lx, ly, data ) ) ; X X if ( ( lx <= 0 ) || ( ly <= 0 ) ) X return ; X CursorIsSaved = !ibm8514cursorSemaphore X && ibm8514CheckCursor( x, y, lx, ly ) ; X ibm8514ATRNotBusy ; X ibm8514CheckQueue( 5 ) ; X PLNWENBL( planes ) ; X SETMODE( M_VAR ) ; X SETCOL1( fg ) ; X SETFN0( FNCOLOR0, FNNOP ) ; X SETFN1( FNCOLOR1, mergexlate[merge] ) ; X x &= ~ 03 ; /* alignment happens here */ X X ibm8514CheckQueue( 6 ) ; X SETX0( x ) ; X SETY0( y ) ; X width = ( lx + 7 ) >> 3 ; X SETLX( ( width << 3 ) - 1 ) ; X /* measured in BITS - clip will discard excess */ X SETLY( ly - 1 ) ; X SETXMAX( x + lx - 1 ) ; X COMMAND( ibm8514WriteXYData ) ; X X blockouttransmogrifiedw( data, width * ly * 4 ) ; X X ibm8514ClearQueue( 5 ) ; X SETMODE( M_ONES ) ; X SETFN1( FNCOLOR1, FNREPLACE ) ; X SETFN0( FNCOLOR0, FNREPLACE ) ; X PLNWENBL( ibm8514ALLPLANES ) ; X SETXMAX( _8514_SCREEN_WIDTH - 1 ) ; X X if ( CursorIsSaved ) X ibm8514ReplaceCursor() ; X return ; X} X X/* Used For Stipples */ Xvoid Xibm8514DrawMonoImage( data, x, y, lx, ly, fg, merge, planes ) Xregister unsigned char *data ; Xint x, y, lx, ly ; Xunsigned long int fg ; Xint merge ; Xunsigned long int planes ; X{ X/*WARNING WARNING WARNING this routine X* ALIGNS X TO BE A MULTIPLE OF FOUR!!! X* X* Use ibm8514StageMono and Blit to get monochrome images elsewhere X*/ X register int width ; X int CursorIsSaved ; X XTRACE( ( "ibm8514DrawMonoImage( planes=x%x, merge=x%x, x=x%x, y=x%x, lx=x%x, ly=x%x, data=x%x )\n", X planes, merge, x, y, lx, ly, data ) ) ; X X if ( ( lx <= 0 ) || ( ly <= 0 ) ) X return ; X X CursorIsSaved = !ibm8514cursorSemaphore && ibm8514CheckCursor( x, y, lx, ly ) ; X X ibm8514ATRNotBusy ; X ibm8514CheckQueue( 8 ) ; X PLNWENBL( planes ) ; X SETMODE( M_VAR ) ; X SETCOL1( fg ) ; X SETFN0( FNCOLOR0, FNNOP ) ; X SETFN1( FNCOLOR1, mergexlate[merge] ) ; X x &= ~ 03 ; /* alignment happens here */ X X SETX0( x ) ; X SETY0( y ) ; X X width = ( lx + 31 ) >> 5 ; X SETLX( ( 32*width ) - 1 ) ; /* measured in BITS - clip will discard excess */ X X ibm8514CheckQueue( 3 ) ; X SETLY( ly - 1 ) ; X SETXMAX( x + lx - 1 ) ; X COMMAND( ibm8514WriteXYData ) ; X blockouttransmogrifiedw( data, width*ly*4 ) ; X X ibm8514ClearQueue( 5 ) ; X SETMODE( M_ONES ) ; X SETFN1( FNCOLOR1, FNREPLACE ) ; X SETFN0( FNCOLOR0, FNREPLACE ) ; X PLNWENBL( ibm8514ALLPLANES ) ; X SETXMAX( _8514_SCREEN_WIDTH - 1 ) ; X X if ( CursorIsSaved ) X ibm8514ReplaceCursor() ; X X return ; X} X X/* Used By "Glyph-Blit" */ Xvoid Xibm8514ByteAlignMonoImage( planes, merge, x, y, lx, ly, data ) Xunsigned long int planes ; Xint merge, x, y, lx, ly ; Xregister unsigned char *data ; X{ X/*WARNING WARNING WARNING this routine merges 1's to requested planes and 0's X* ro requested planes, BUT ALIGNS X TO BE A MULTIPLE OF FOUR!!! X* X* Use ibm8514StageMono and Blit to get monochrome images elsewhere X*/ X register int width ; X int CursorIsSaved ; X XTRACE( ( "ibm8514ByteAlignMonoImage( planes=x%x, merge=x%x, x=x%x, y=x%x, lx=x%x, ly=x%x, data=x%x )\n", X planes, merge, x, y, lx, ly, data ) ) ; X X if ( ( lx <= 0 ) || ( ly <= 0 ) ) X return ; X X CursorIsSaved = !ibm8514cursorSemaphore && ibm8514CheckCursor( x, y, lx, ly ) ; X X ibm8514ATRNotBusy ; X ibm8514CheckQueue( 8 ) ; X PLNWENBL( planes ) ; X SETMODE( M_VAR ) ; X SETFN0( FNCOLOR0, mergexlate[merge] ) ; X SETFN1( FNCOLOR1, mergexlate[merge] ) ; X x &= ~ 03 ; /* alignment happens here */ X X SETX0( x ) ; X SETY0( y ) ; X width = ( lx + 7 ) >> 3 ; X SETLX( ( 8*width ) - 1 ) ; /* measured in BITS */ X SETLY( ly - 1 ) ; X X ibm8514CheckQueue( 4 ) ; X SETCOL1( 255 ) ; X SETCOL0( 0 ) ; X SETXMAX( x + lx - 1 ) ; X COMMAND( ibm8514WriteXYData ) ; X blockouttransmogrifiedw( data, width * ly ) ; X X ibm8514ClearQueue( 5 ) ; X SETMODE( M_ONES ) ; X SETFN1( FNCOLOR1, FNREPLACE ) ; X SETFN0( FNCOLOR0, FNREPLACE ) ; X PLNWENBL( ibm8514ALLPLANES ) ; X SETXMAX( _8514_SCREEN_WIDTH - 1 ) ; X X if ( CursorIsSaved ) X ibm8514ReplaceCursor() ; X X return ; X} END-of-ibm8514/brcMono.c echo x - ibm8514/brcOSD.c sed 's/^X//' >ibm8514/brcOSD.c << 'END-of-ibm8514/brcOSD.c' X/* X * Copyright IBM Corporation 1987,1990 X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of IBM not be X * used in advertising or publicity pertaining to distribution of the X * software without specific, written prior permission. X * X * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL X * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS X * SOFTWARE. X * X*/ X/* X * PRPQ 5799-PFF (C) COPYRIGHT IBM CORPORATION 1987,1990 X * LICENSED MATERIALS - PROPERTY OF IBM X * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083 X */ X/* X * Hardware interface routines for IBM 8514/A adapter for X * X.11 server(s) on IBM equipment. X * X */ X X#include X#include X X#if defined(ibm032) && defined(BSDrt) X#define ATR X#include X#else X#ifdef i386 X#if defined(IBM_OS_HAS_HFT) || !defined(IBM_OS_HAS_X_QUEUE) X#include "ibmXhftMap.h" X#endif X /* Nothing Yet */ X#else X ******** ERROR ******** X#endif X#endif X X#include "X.h" X#include "miscstruct.h" X#include "scrnintstr.h" X#include "cursorstr.h" X X#include "ibmScreen.h" X#include "ibmTrace.h" X X#include "x8514.h" X Xextern void ibmInfoMsg() ; X Xextern PixmapFormatRec ibm8514Formats[] ; X/* GLOBAL FILE DESCRIPTOR -- for ioctl's etc. */ Xint ibm8514FD = -1 ; X X/*ARGSUSED*/ Xvoid Xibm8514osdInit( index ) Xregister int index ; X{ X TRACE( ( "ibm8514osdInit()\n" ) ) ; X#ifdef ibm032 X /* Nothing Yet */ X#else X#ifdef i386 X /* Nothing Yet */ X#else X ******** ERROR ******** X#endif X#endif Xreturn ; X} X X/********************************************************************** ********/ X Xvoid Xibm8514SetVideoRegisters() X{ X#if !defined(BSDrt) X /* THE FOLLOWING 8 OUTPUT VALUES ARE MAGIC NUMBERS */ X /* Note that they are not queued */ X /* This is the only place they occur, so screw the #define theory */ X ibm8514outw( 0x12e8, 0x0660 ) ; /* frame total width */ X ibm8514outw( 0x1ae8, 0x0600 ) ; /* frame sync posn */ X ibm8514outw( 0x16e8, 0x05fb ) ; /* frame blank start */ X outb( 0x1ee8, 0x08 ) ; /* frame sync width */ X ibm8514outw( 0x02e8, 0x009d ) ; /* line total length */ X ibm8514outw( 0x0ae8, 0x0081 ) ; /* line sync posn */ X ibm8514outw( 0x06e8, 0x007f ) ; /* line blank start */ X ibm8514outw( 0x0ee8, 0x0016 ) ; /* line sync width */ X /* END MAGIC NUMBERS */ X#endif X return ; X} X X/********************************************************************** ********/ X Xint Xibm8514Probe() X{ Xregister int fd ; X X#if defined(IBM_OS_HAS_X_QUEUE) || defined(BSDrt) X if ( ( fd = open( IBM8514_DEV_FILE, O_RDWR | O_NDELAY ) ) >= 0 ) { X#if defined(i386) X (void) ioctl( fd, 'B'<<8|1, 0 ) ; /* 8514 specific I/O permissions !! */ X#else X (void) ioctl( fd, BUFINIT8514, 0 ) ; X#endif X } X else /* Open of device file failed */ X#endif /* IBM_OS_HAS_X_QUEUE */ X#if defined(IBM_OS_HAS_HFT) X { X if ( ( fd = hftProbe( IBM8514xHFTid ) ) < 0 ) X return fd ; X } X#else /* No hft and initial devFile open failed */ X return -1 ; X#endif /* defined(IBM_OS_HAS_HFT) */ X X ibmInfoMsg( "Found a %d-plane 8514a with ", X ibm8514Formats[0].depth = ibm8514QueryPlanes() ) ; X X switch ( ibm8514QueryHead() ) X { X ibmInfoMsg( "a Color display\n" ) ; X break ; X ibmInfoMsg( "a Grayscale display\n" ) ; X break ; X ibmInfoMsg( "no known display\n" ) ; X ErrorF( "Not bothering with headless 8514\n" ) ; X (void) close( fd ) ; X return -1 ; X } X return ibm8514FD = fd ; X /*NOTREACHED*/ X} X X#if defined(ibm032) && defined(ATRIO) X/* on the 386 blockoutw should be assembly coded to use "rep outs %dx, *%esi" */ Xvoid Xblockoutw( values, n ) Xregister unsigned char *values ; Xregister int n ; X{ X /* I/O port type is 4 bytes for 6152 but only 2 for i386 !! */ X register volatile unsigned long int *ptr ; X Xif ( !n ) X return ; X Xptr = (volatile unsigned long int *) ( VARDATA | WORDADD ) ; X X/* Test Alignment */ Xif ( ( (unsigned long int) values ) & 1 ) { X register unsigned long int tmpBuf ; X X tmpBuf = *values++ << 16 ; /* Now We're Aligned */ X while ( --n ) { X tmpBuf |= *( (unsigned short int *) values ) ; X *ptr = (unsigned long int) ( tmpBuf >> 8 ) ; X values += sizeof (unsigned short int) ; X tmpBuf <<= 16 ; X } X *ptr = (unsigned long int) ( ( tmpBuf >> 8 ) | *values ) ; X} Xelse X for ( n++ ; --n ; values += sizeof (unsigned short int) ) X *ptr = (unsigned long int) *( (unsigned short int *) values ) ; X Xreturn ; X} X Xvoid Xblockinw( data, n ) Xregister unsigned char *data ; Xregister int n ; X{ X/* I/O port type is 4 bytes for 6152 but only 2 for i386 !! */ Xregister unsigned long int *ptr ; X Xif ( !n ) X return ; X Xptr = (unsigned long int *) ( VARDATA | WORDADD ) ; X X/* Test Alignment */ Xif ( ( (unsigned long int) data ) & 1 ) { X register unsigned long int tmpBuf ; X X tmpBuf = *ptr ; X *data++ = tmpBuf >> 8 ; X tmpBuf <<= 16 ; X while ( --n ) { X tmpBuf |= (unsigned short) *ptr ; X *( (unsigned short int *) data ) = tmpBuf >> 8 ; X tmpBuf <<= 16 ; X data += sizeof (unsigned short int) ; X } X *data = tmpBuf >> 16 ; X X} Xelse X for ( n++ ; --n ; data += sizeof (unsigned short int) ) X *( (unsigned short int *) data ) = (unsigned short) *ptr ; X Xreturn ; X} X X#else X#if defined(i386) && defined(PCIO) X X#if defined(USE_PORTABLE_BLOCKOUTW) Xvoid Xblockoutw( values, n ) Xregister unsigned short *values ; Xregister int n ; X{ X#if HALFQBUF != 4 X ******** ERROR ******** X#endif X for ( ; n >= HALFQBUF ; n -= HALFQBUF ) { X ibm8514ClearQueue( HALFQBUF ) ; X outw( VARDATA, *values++ ) ; /* This assume that HALFQBUF is 4 */ X outw( VARDATA, *values++ ) ; X outw( VARDATA, *values++ ) ; X outw( VARDATA, *values++ ) ; X } X if ( n ) { /* Left over < HALFQBUF */ X ibm8514ClearQueue( n ) ; X while ( n-- ) X outw( VARDATA, *values++ ) ; X } X return ; X} X X#endif /* #if defined(USE_PORTABLE_BLOCKOUTW) */ X Xvoid Xblockinw( data, n ) Xregister unsigned char *data ; Xregister int n ; X{ Xfor ( n++ ; --n ; data += sizeof (unsigned short int) ) X *( (unsigned short int *) data ) = inw( VARDATA ) ; X Xreturn ; X} X#else X ******** ERROR -- RT w/ Family-1 Bus ?? X#endif X#endif END-of-ibm8514/brcOSD.c echo x - ibm8514/brcOutL.c sed 's/^X//' >ibm8514/brcOutL.c << 'END-of-ibm8514/brcOutL.c' X/* X * Copyright IBM Corporation 1987,1990 X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of IBM not be X * used in advertising or publicity pertaining to distribution of the X * software without specific, written prior permission. X * X * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL X * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS X * SOFTWARE. X * X*/ X/* X * PRPQ 5799-PFF (C) COPYRIGHT IBM CORPORATION 1987,1990 X * LICENSED MATERIALS - PROPERTY OF IBM X * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083 X */ X/* X * Hardware interface routines for IBM 8514/A adapter for X * X.11 server(s) on IBM equipment. X * X */ X/* $Header: /andrew/X11/r3src/r3plus/server/ddx/ibm/ibm8514/RCS/brcOutL.c,v 6.3 89/05/07 15:12:37 paul Exp $ */ X/* $Source: /andrew/X11/r3src/r3plus/server/ddx/ibm/ibm8514/RCS/brcOutL.c,v $ */ X X#ifndef lint Xstatic char *rcsid = "$Header: /andrew/X11/r3src/r3plus/server/ddx/ibm/ibm8514/RCS/brcOutL.c,v 6.3 89/05/07 15:12:37 paul Exp $" ; X#endif X X/* SOLID AREA FILL OUTLINE X * X * This draws a strange line intended to be used as an outline for area fill X * IT SHOULD NOT BE USED FOR ANYTHING ELSE X * X */ X X#include "X.h" X X#include "OScompiler.h" X X#include "x8514.h" X X#include "ibmTrace.h" X Xextern int mergexlate[] ; Xextern int ibm8514cursorSemaphore ; X X#define VERT 1 X#define HORIZ 2 X#define SLOP1 3 X#define SLOPN1 4 X#define YUCK 5 X Xvoid Xibm8514Outline( planes, x0, y0, x1, y1 ) Xunsigned long int planes ; Xint x0, y0, x1, y1 ; X{ Xint saved ; Xint qd,k1,k2,dx,dy,adx,ady ; X XTRACE(("ibm8514OutLine(x0=%d, y0=%d, x1=%d, y1=%d)\n", x0,y0,x1,y1)) ; X Xdx = x1 - x0 ; Xadx = ABS( dx ) ; Xdy = y1 - y0 ; Xady = ABS( dy ) ; X Xsaved = !ibm8514cursorSemaphore X && ibm8514CheckCursor( MIN( x0, x1 ), MIN( y0, y1 ), adx, ady ) ; X Xibm8514ATRNotBusy ; Xibm8514CheckQueue( 5 ) ; XSETFN1( FNCOLOR1, mergexlate[GXxor] ) ; XSETCOL1( 255 ) ; XPLNWENBL( planes ) ; XPLNRENBL( FILL_STAGE_RPLANE ) ; XSETET( 0 ) ; /* bresenham error term. See README file about this */ X Xif ( !dx ) X qd = VERT ; Xelse if ( !dy ) X qd = HORIZ ; Xelse if ( dx == dy ) X qd = SLOPN1 ; Xelse if ( adx == ady ) X qd = SLOP1 ; Xelse X qd = YUCK ; X Xibm8514CheckQueue( 6 ) ; /* Max # of outw's in switch statement */ Xswitch ( qd ) { X SETLX( ady ) ; /* stepping along Y */ X SETY0( ( dy > 0 ) ? y0 : y1 ) ; X SETX0( x0 ) ; X COMMAND( 0xA0DF ) ; X break ; X break ; X SETLX( adx ) ; X if ( dx > 0 ) { X SETX0( x1 ) ; X SETY0( y1 ) ; X } X else { X SETX0( x0 ) ; X SETY0( y0 ) ; X } X COMMAND( 0xA0BF ) ; X break ; X SETLX( adx ) ; X if ( dx > 0 ) { X SETX0( x0 ) ; X SETY0( y0 ) ; X } X else { X SETX0( x1 ) ; X SETY0( y1 ) ; X } X COMMAND( 0xA0FF ) ; X break ; X case YUCK: /* slope is not 0,1,-1,or infinite */ X if ( adx >= ady ) { /* STEPX */ X k1 = 2 * ady ; X SETK1( k1 ) ; X k2 = k1 - 2 * adx ; X SETK2( k2 ) ; X SETLX( adx ) ; X if ( dy > 0 ) { X SETX0( x0 ) ; X SETY0( y0 ) ; X if ( dx > 0 ) X COMMAND( 0xA0B7 ) ; /*QUAD1*/ X else X COMMAND( 0xA097 ) ; /*QUAD 4*/ X } X else { X SETX0( x1 ) ; X SETY0( y1 ) ; X if ( dx > 0 ) X COMMAND( 0xA097 ) ; /*QUAD8*/ X else X COMMAND( 0xA0B7 ) ; /*QUAD 5*/ X } X } X else { /* STEPY */ X k1 = 2 * adx ; X SETK1( k1 ) ; X k2 = k1 - 2 * ady ; X SETK2( k2 ) ; X SETLX( ady ) ; X if ( dy > 0 ) { X SETX0( x0 ) ; X SETY0( y0 ) ; X if ( dx > 0 ) X COMMAND( 0xA0F7 ) ; /*QUAD2*/ X else X COMMAND( 0xA0D7 ) ; /*QUAD 3*/ X } X else { X SETX0( x1 ) ; X SETY0( y1 ) ; X if ( dx > 0 ) X COMMAND( 0xA0D7 ) ; /*QUAD7*/ X else X COMMAND( 0xA0F7) ; /*QUAD 6*/ X } X } X break ; X } /* end switch */ X Xibm8514ClearQueue( 3 ) ; XSETFN1( FNCOLOR1, FNREPLACE ) ; XPLNWENBL( ibm8514ALLPLANES ) ; XPLNRENBL( ibm8514ALLPLANES ) ; X Xif ( saved ) X ibm8514ReplaceCursor() ; Xreturn ; X} END-of-ibm8514/brcOutL.c echo x - ibm8514/brcPgon.c sed 's/^X//' >ibm8514/brcPgon.c << 'END-of-ibm8514/brcPgon.c' X/* X * Copyright IBM Corporation 1987,1990 X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of IBM not be X * used in advertising or publicity pertaining to distribution of the X * software without specific, written prior permission. X * X * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL X * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS X * SOFTWARE. X * X*/ X/* X * PRPQ 5799-PFF (C) COPYRIGHT IBM CORPORATION 1987,1990 X * LICENSED MATERIALS - PROPERTY OF IBM X * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083 X */ X/* X * Hardware interface routines for IBM 8514/A adapter for X * X.11 server(s) on IBM equipment. X * X */ X/* $Header: /andrew/X11/r3src/earlyRelease/server/ddx/ibm/ibm8514/RCS/brcPgon.c,v 6.3 88/11/16 18:46:44 paquin Exp $ */ X/* $Source: /andrew/X11/r3src/earlyRelease/server/ddx/ibm/ibm8514/RCS/brcPgon.c,v $ */ X X#ifndef lint Xstatic char *rcsid = "$Header: /andrew/X11/r3src/earlyRelease/server/ddx/ibm/ibm8514/RCS/brcPgon.c,v 6.3 88/11/16 18:46:44 paquin Exp $"; X#endif X X/* POLYGON FILL X * X */ X#include "X.h" X#include "pixmapstr.h" X#include "gcstruct.h" X#include "windowstr.h" X#include "colormapst.h" X X#include "ppc.h" X#include "ibmTrace.h" X X#include "x8514.h" Xextern int mfbGCPrivateIndex; X Xvoid Xibm8514FillPolygon( dst, pgc, shape, mode, count, pPts ) XDrawablePtr dst; Xregister GCPtr pgc; Xint shape, mode; Xregister int count; XDDXPointPtr pPts; X{ Xregister DDXPointPtr ppt; Xint i ; X Xif ( !( i = count ) ) X return ; X Xif (((ppcPrivGCPtr)pgc->devPrivates[mfbGCPrivateIndex].ptr)->colorRrop.fill Style != FillSolid) X { X miFillPolygon(dst, pgc, shape, mode, count, pPts); X return; X } X Xif (dst->type != DRAWABLE_WINDOW) X { X ErrorF("ibm8514FillPolygon: not a window\n"); X miFillPolygon(dst, pgc, shape, mode, count, pPts); X return; X } X Xppt = pPts ; Xif ( pgc->miTranslate ) { X if ( mode != CoordModeOrigin) X for ( ppt++ ; count-- ; ppt++ ) { X ppt->x += (ppt-1)->x; X ppt->y += (ppt-1)->y; X } X} Xelse X if ( mode == CoordModePrevious ) X for ( ppt++ ; count-- ; ppt++ ) { X ppt->x += (ppt-1)->x ; X ppt->y += (ppt-1)->y ; X } X Xibm8514SolidFillPoly( dst, pgc, i, pPts ) ; X Xreturn ; X} END-of-ibm8514/brcPgon.c echo x - ibm8514/brcPoly.c sed 's/^X//' >ibm8514/brcPoly.c << 'END-of-ibm8514/brcPoly.c' X/* X * Copyright IBM Corporation 1987,1990 X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of IBM not be X * used in advertising or publicity pertaining to distribution of the X * software without specific, written prior permission. X * X * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL X * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS X * SOFTWARE. X * X*/ X/* X * PRPQ 5799-PFF (C) COPYRIGHT IBM CORPORATION 1987,1990 X * LICENSED MATERIALS - PROPERTY OF IBM X * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083 X */ X/* X * Hardware interface routines for IBM 8514/A adapter for X * X.11 server(s) on IBM equipment. X * X */ X/* $Header: /andrew/X11/r3src/r3plus/server/ddx/ibm/ibm8514/RCS/brcPoly.c,v 6.4 89/05/07 15:18:46 jeff Exp $ */ X/* $Source: /andrew/X11/r3src/r3plus/server/ddx/ibm/ibm8514/RCS/brcPoly.c,v $ */ X X#ifndef lint Xstatic char *rcsid = "$Header: /andrew/X11/r3src/r3plus/server/ddx/ibm/ibm8514/RCS/brcPoly.c,v 6.4 89/05/07 15:18:46 jeff Exp $"; X#endif X X/* FILL A POLYGON X * X */ X#include "X.h" X#include "misc.h" X#include "gcstruct.h" X#include "windowstr.h" X#include "colormapst.h" X#include "regionstr.h" X X#include "OScompiler.h" X X#include "ppc.h" X#include "ibmTrace.h" X X#include "x8514.h" X Xextern int ibm8514Disabled ; X Xextern int ibm8514cursorSemaphore ; Xextern int mfbGCPrivateIndex ; X X#define CLEARSTAGE(W,H) \ X ibm8514DrawRectangle(0,GXclear, MONO_STAGE_WPLANE | FILL_STAGE_WPLANE,\ X MONO_STAGE_X, MONO_STAGE_Y, W, H) X Xstatic void Xibm8514StageFill(w,h) Xint w,h ; X{ Xibm8514ATRNotBusy ; Xibm8514CheckQueue(5); XPLNRENBL(FILL_STAGE_RPLANE); XSETCOL1(255); XPLNWENBL(MONO_STAGE_WPLANE); XSETFN1(FNCOLOR1, FNREPLACE); XSETX0(MONO_STAGE_X); Xibm8514CheckQueue(5); XSETY0(MONO_STAGE_Y); XSETLX(w); XSETLY(h); XSETMODE(M_PLFILL); XCOMMAND(0x42f7); X Xibm8514ClearQueue(3); XPLNWENBL(RPLANES); XPLNRENBL(RPLANES); XSETMODE(M_ONES); Xreturn; X} X Xibm8514SolidFillPoly( pDraw, pGC, count, pts) X DrawablePtr pDraw; X GCPtr pGC; X int count; X DDXPointPtr pts; X{ X RegionPtr pCC; X int saved, alu ; X unsigned long int wPM ; X int nbox, x0, y0; X int i, j, miny, minx, maxx, maxy, bboxh, bboxw, X thisboxh, x1, y1, destx, desty, ydelta; X unsigned long int fg ; X BoxRec *pbox; X Xif ( ibm8514Disabled ) X return ; X XTRACE(("ibm8514SolidFillPoly: pDraw=x%x, pGC=x%x, count=%d, pts=x%x\n", X pDraw, pGC, count, pts)); XpCC = ((ppcPrivGC *)pGC->devPrivates[mfbGCPrivateIndex].ptr)->pCompositeClip; X Xif ( !( nbox = REGION_NUM_RECTS(pCC) ) || ( ( alu = pGC->alu ) == GXnoop ) ) X return; X XwPM = pGC->planemask; Xfg = pGC->fgPixel; X Xminx = miny = _8514_SCREEN_WIDTH; Xmaxx = maxy = 0; Xfor (i=0; iy; Xdestx = minx + pDraw->x; Xbboxw = maxx-minx+1; Xbboxh = maxy-miny+1; Xydelta = 0; X Xsaved = !ibm8514cursorSemaphore X && ibm8514CheckCursor(destx, desty, bboxw, bboxh); Xibm8514cursorSemaphore++ ; X Xwhile (bboxh>0) X { X /* set up the staging area to do the fill*/ X ibm8514ClearQueue(4); X SETXMIN(MONO_STAGE_X); X SETYMIN(MONO_STAGE_Y); X SETXMAX(1023); X SETYMAX(1023); X X thisboxh = MIN(MONO_STAGE_SIZE,bboxh); X CLEARSTAGE(bboxw, thisboxh); X X /* Draw the edges */ X for (j=0; jx1); X SETYMIN(pbox->y1); X SETXMAX(pbox->x2-1); X SETYMAX(pbox->y2-1); X X ibm8514BlitFG(MONO_STAGE_RPLANE, wPM, X fg, alu, X MONO_STAGE_X, MONO_STAGE_Y, X destx, desty, X bboxw,thisboxh); X } X X desty += MONO_STAGE_SIZE; X ydelta += MONO_STAGE_SIZE; X bboxh -= MONO_STAGE_SIZE; X } X X Xibm8514ClearQueue(6); XSETYMIN(0); XSETXMIN(0); XSETYMAX( 1023 ) ; XSETXMAX(_8514_SCREEN_WIDTH-1); XPLNRENBL(RPLANES); XPLNWENBL(WPLANES); X Xif ( !--ibm8514cursorSemaphore && saved ) X ibm8514ReplaceCursor(); Xreturn; X} END-of-ibm8514/brcPoly.c echo x - ibm8514/brcProcs.h sed 's/^X//' >ibm8514/brcProcs.h << 'END-of-ibm8514/brcProcs.h' X/* X * Copyright IBM Corporation 1987,1990 X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of IBM not be X * used in advertising or publicity pertaining to distribution of the X * software without specific, written prior permission. X * X * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL X * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS X * SOFTWARE. X * X*/ X/* X * PRPQ 5799-PFF (C) COPYRIGHT IBM CORPORATION 1987,1990 X * LICENSED MATERIALS - PROPERTY OF IBM X * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083 X */ X/* X * Hardware interface routines for IBM 8514/A adapter for X * X.11 server(s) on IBM equipment. X * X */ X/* $Header: /andrew/X11/r3src/earlyRelease/server/ddx/ibm/ibm8514/RCS/brcProcs.h,v 6.4 88/11/21 13:47:06 jeff Exp $ */ X/* $Source: /andrew/X11/r3src/earlyRelease/server/ddx/ibm/ibm8514/RCS/brcProcs.h,v $ */ X X#if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) Xstatic char *rcsidibm8514procs = "$Header: /andrew/X11/r3src/earlyRelease/server/ddx/ibm/ibm8514/RCS/brcProcs.h,v 6.4 88/11/21 13:47:06 jeff Exp $"; X#endif X X#if !defined(NO_FUNCTION_PROTOTYPES) X/* brcCurs.o */ X Xextern int ibm8514CheckCursor( X const int x, X const int y, X const int lx, X const int ly ) ; X Xextern void ibm8514ReplaceCursor( X void ) ; X Xextern int ibm8514cursorSemaphore ; X X#if !defined(CURSOR_ONLY) Xextern void ibm8514RemoveCursor( X void ) ; X Xextern void ibm8514CursorInit( X int index ) ; X Xextern Bool ibm8514RealizeCursor( X ScreenPtr pScr, X CursorPtr pCurs ) ; X Xextern Bool ibm8514UnrealizeCursor( X ScreenPtr pScr, X CursorPtr pCurs ) ; X Xextern void ibm8514ColorCursor( X unsigned long int fg, X unsigned long int bg ) ; X Xextern void ibm8514RecolorCursor( X ColormapPtr cmap ) ; X Xextern int ibm8514DisplayCursor( X ScreenPtr pScr, X CursorPtr pCurs ) ; X Xextern void ibm8514ShowCursor( X int x, X int y ) ; X X/* brcBlit.o */ X Xextern void ibm8514Bitblt( X int merge, X int rpm, X int wpm, X int x0, X int y0, X int x1, X int y1, X int lx, X int ly ) ; X Xextern void ibm8514BlitFG( X int rpm, X int wpm, X int fg, X int merge, X int x0, X int y0, X int x1, X int y1, X int lx, X int ly ) ; X Xextern void ibm8514BlitFGBG( X int rpm, X int wpm, X int fg, X int bg, X int merge, X int x0, X int y0, X int x1, X int y1, X int lx, X int ly ) ; X X/* brcCmap.o */ X Xextern void ibm8514SetColor( X unsigned long int number, X unsigned short int r, X unsigned short int g, X unsigned short int b, X VisualPtr pVisual ) ; X X/* brcFillSp.o */ X Xextern void ibm8514SolidFS( X DrawablePtr pDrawable, X GCPtr pGC, X int nInit, X DDXPointPtr pptInit, X int *pwidthInit, X int fSorted ) ; X Xextern void ibm8514TileFS( X DrawablePtr pDrawable, X GC *pGC, X int nInit, X DDXPointPtr pptInit, X int *pwidthInit, X int fSorted ) ; X Xextern void ibm8514StippleFS( X DrawablePtr pDrawable, X GC *pGC, X int nInit, X DDXPointPtr pptInit, X int *pwidthInit, X int fSorted ) ; X Xextern void ibm8514OPStippleFS( X DrawablePtr pDrawable, X GC *pGC, X int nInit, X DDXPointPtr pptInit, X int *pwidthInit, X int fSorted ) ; X X/* brcFillSp.o */ X Xextern void ibm8514SolidFS( X DrawablePtr pDrawable, X GCPtr pGC, X int nInit, X DDXPointPtr pptInit, X int *pwidthInit, X int fSorted ) ; X Xextern void ibm8514TileFS( X DrawablePtr pDrawable, X GC *pGC, X int nInit, X DDXPointPtr pptInit, X int *pwidthInit, X int fSorted ) ; X Xextern void ibm8514StippleFS( X DrawablePtr pDrawable, X GC *pGC, X int nInit, X DDXPointPtr pptInit, X int *pwidthInit, X int fSorted ) ; X Xextern void ibm8514OPStippleFS( X DrawablePtr pDrawable, X GC *pGC, X int nInit, X DDXPointPtr pptInit, X int *pwidthInit, X int fSorted ) ; X X/* brcGC.o */ Xextern Mask ibm8514ChangeGCtype( X GC *pGC, X ppcPrivGCPtr devPriv ) ; X Xextern Mask ibm8514ChangeWindowGC( X GC *pGC, X Mask changes ) ; X X/* brcGetSp.o */ X Xextern void ibm8514GetSpans( X DrawablePtr pDrawable, X int wMax, X DDXPointPtr ppt, X int *pwidth, X int nspans, X unsigned int *pdstStart ) ; X X/* brcImg.o */ X Xextern void ibm8514DrawColorImage( X int x, X int y, X int w, X int h, X unsigned char *data, X int RowIncrement, X int merge, X unsigned long int planes ) ; X Xextern void ibm8514ReadColorImage( X int x, X int y, X int lx, X int ly, X unsigned char *data, X int RowIncrement ) ; X X/* brcMono.o */ X Xextern void ibm8514AlignMonoImage( X unsigned long int planes, X int merge, X int x, X int y, X int lx, X int ly, X unsigned char *data ) ; X Xextern void ibm8514StageMono( X int lx, X int ly, X unsigned char *data ) ; X Xextern void ibm8514FillMonoImage( X unsigned long int planes, X unsigned long int fg, X unsigned long int bg, X int merge, X int x, X int y, X int lx, X int ly, X unsigned char *data ) ; X Xextern void ibm8514DrawMonoByteImage( X unsigned char *data, X int x, X int y, X int lx, X int ly, X unsigned long int fg, X int merge, X unsigned long int planes ) ; X Xextern void ibm8514DrawMonoImage( X unsigned char *data, X int x, X int y, X int lx, X int ly, X unsigned long int fg, X int merge, X unsigned long int planes ) ; X Xextern void ibm8514ByteAlignMonoImage( X unsigned long int planes, X int merge, X int x, X int y, X int lx, X int ly, X unsigned char *data ) ; X/* brcScrInit.o */ X Xextern Bool ibm8514InitScreen( X int index, X ScreenPtr pScreen, X pointer pbits, X int xsize, X int ysize, X int dpix, X int dpiy ) ; X X/* brcSuspScr.o */ X Xextern void ibm8514SuspendScreenAndSave( X void ) ; X Xextern void ibm8514RestoreScreenAndActivate( X void ) ; X X/* brcIO.c */ X Xextern Bool ibm8514ScreenInit( X const int index, X ScreenPtr const pScreen, X int const argc, X char * const * const argv ) ; X Xextern Bool ibm8514ScreenClose( X const int index, X ScreenPtr const pScreen ) ; X X/* brcUtils.o */ X Xextern short int ibm8514QueryHead( X void ) ; X Xextern int ibm8514QueryPlanes( X void ) ; X Xextern void ibm8514InitializeHardwareState( X void ) ; X Xextern int ibm8514ScreenInitHW( X int index ) ; X X#if defined(ibm032) Xextern unsigned short int ibm8514inw( X unsigned int addr ) ; X#endif X X/* brcGBlt.o */ X Xextern void ibm8514ImageGlyphBlt( X DrawablePtr pDrawable, X GC *pGC, X int x, X int y, X unsigned int nglyph, X CharInfoPtr *ppci, X unsigned char *pglyphBase ) ; X X/* brcLine.o */ X Xextern void ibm8514HorzLine( X unsigned long int color, X int alu, X unsigned long int mask, X int x, X int y, X int w ) ; X Xextern void ibm8514VertLine( X unsigned long int color, X int alu, X unsigned long int mask, X int x, X int y, X int h ) ; X Xextern void ibm8514BresLine( X unsigned long int color, X int alu, X unsigned long int mask, X int signdx, X int signdy, X int axis, X int x, X int y, X int et, X int e1, X int e2, X int len ) ; X X/* brcStip.o */ X Xextern void ibm8514UnnaturalOpStipple( X PixmapPtr pStipple, X unsigned long int fg, X unsigned long int bg, X int merge, X unsigned long int planes, X int x, X int y, X int w, X int h, X int xSrc, X int ySrc ) ; X Xextern void ibm8514UnnaturalStipple( X PixmapPtr pStipple, X unsigned long int fg, X int merge, X unsigned long int planes, X int x, X int y, X int w, X int h, X int xSrc, X int ySrc ) ; X Xextern void ibm8514Stipple( X PixmapPtr pStipple, X unsigned long int fg, X int merge, X unsigned long int planes, X int x, X int y, X int w, X int h, X int xSrc, X int ySrc ) ; X Xextern void ibm8514OpStipple( X PixmapPtr pStipple, X unsigned long int fg, X unsigned long int bg, X int merge, X unsigned long int planes, X int x, X int y, X int w, X int h, X int xSrc, X int ySrc ) ; X X/* brcFont.o */ X Xextern void ibm8514InitFontCache( X void ) ; X Xextern Bool ibm8514RealizeFont( X ScreenPtr pscr, X FontPtr pFont ) ; X Xextern Bool ibm8514UnrealizeFont( X ScreenPtr pscr, X FontPtr pFont ) ; X X/* brcText.o */ X Xextern int ibm8514PolyText8( X DrawablePtr pDraw, X GCPtr pGC, X int x, X int y, X int count, X char *chars ) ; X Xextern int ibm8514PolyText16( X DrawablePtr pDraw, X GCPtr pGC, X int x, X int y, X int count, X unsigned short int *chars ) ; X Xextern void ibm8514ImageText8( X DrawablePtr pDraw, X GCPtr pGC, X int x, X int y, X int count, X char *chars ) ; X Xextern void ibm8514ImageText16( X DrawablePtr pDraw, X GCPtr pGC, X int x, X int y, X int count, X unsigned short int *chars ) ; X X/* brcPoly.c */ X Xextern int ibm8514SolidFillPoly( X DrawablePtr pDraw, X GCPtr pGC, X int count, X DDXPointPtr pts ) ; X X/* brcPgon.o */ X Xextern void ibm8514FillPolygon( X DrawablePtr dst, X GCPtr pgc, X int shape, X int mode, X int count, X DDXPointPtr pPts ) ; X X/* brcOutL.o */ X Xextern void ibm8514Outline( X unsigned long int planes, X int x0, X int y0, X int x1, X int y1 ) ; X X/* brcRect.o */ X Xextern void ibm8514DrawRectangle( X unsigned long int color, X int merge, X unsigned long int planes, X short int x0, X short int y0, X short int lx, X short int ly ) ; X X/* brcTile.o */ X Xextern void ibm8514TileRect( X PixmapPtr pTile, X int merge, X unsigned long int planes, X int x, X int y, X int w, X int h, X int xSrc, X int ySrc ) ; X Xextern int ibm8514RotateTile( X int w, X int h, X int dx, X int dy ) ; X X/* brcPushPxl.o */ X Xextern void ibm8514PushPixels( X GCPtr pGC, X PixmapPtr pBitMap, X DrawablePtr pDrawable, X int dx, X int dy, X int xOrg, X int yOrg ) ; X X/* brcOSD.o */ X Xextern void ibm8514osdInit( X int index ) ; X Xextern int ibm8514Probe( X void ) ; X Xextern void blockoutw( X unsigned int port, X unsigned short int *values, X int n ) ; X Xextern void blockinw( X unsigned short int addr, X unsigned short int *data, X int n ) ; X X#endif /* CURSOR_ONLY */ X#else X/* brcCurs.o */ Xextern int ibm8514CheckCursor() ; Xextern void ibm8514ReplaceCursor() ; Xextern int ibm8514cursorSemaphore ; X#if !defined(CURSOR_ONLY) Xextern void ibm8514RemoveCursor() ; Xextern void ibm8514CursorInit() ; Xextern Bool ibm8514RealizeCursor() ; Xextern Bool ibm8514UnrealizeCursor() ; Xextern void ibm8514ColorCursor() ; Xextern void ibm8514RecolorCursor() ; Xextern int ibm8514DisplayCursor() ; Xextern void ibm8514ShowCursor() ; X/* brcBlit.o */ Xextern void ibm8514Bitblt() ; Xextern void ibm8514BlitFG() ; Xextern void ibm8514BlitFGBG() ; X/* brcCmap.o */ Xextern void ibm8514SetColor() ; X/* brcFillSp.o */ Xextern void ibm8514SolidFS() ; Xextern void ibm8514TileFS() ; Xextern void ibm8514StippleFS() ; Xextern void ibm8514OPStippleFS() ; X/* brcFillSp.o */ Xextern void ibm8514SolidFS() ; Xextern void ibm8514TileFS() ; Xextern void ibm8514StippleFS() ; Xextern void ibm8514OPStippleFS() ; X/* brcGC.o */ Xextern Mask ibm8514ChangeGCtype() ; Xextern Mask ibm8514ChangeWindowGC() ; X/* brcGetSp.o */ Xextern void ibm8514GetSpans() ; X/* brcImg.o */ Xextern void ibm8514DrawColorImage() ; Xextern void ibm8514ReadColorImage() ; X/* brcMono.o */ Xextern void ibm8514AlignMonoImage() ; Xextern void ibm8514StageMono() ; Xextern void ibm8514FillMonoImage() ; Xextern void ibm8514DrawMonoByteImage() ; Xextern void ibm8514DrawMonoImage() ; Xextern void ibm8514ByteAlignMonoImage() ; X/* brcScrInit.o */ Xextern Bool ibm8514InitScreen() ; X/* brcSuspScr.o */ Xextern void ibm8514SuspendScreenAndSave() ; Xextern void ibm8514RestoreScreenAndActivate() ; X/* brcIO.c */ Xextern Bool ibm8514ScreenInit() ; Xextern Bool ibm8514ScreenClose() ; X/* brcUtils.o */ Xextern short int ibm8514QueryHead() ; Xextern int ibm8514QueryPlanes() ; Xextern void ibm8514InitializeHardwareState() ; Xextern int ibm8514ScreenInitHW() ; X#if defined(ibm032) Xextern unsigned short int ibm8514inw() ; X#endif X/* brcGBlt.o */ Xextern void ibm8514ImageGlyphBlt() ; X/* brcLine.o */ Xextern void ibm8514HorzLine() ; Xextern void ibm8514VertLine() ; Xextern void ibm8514BresLine() ; X/* brcStip.o */ Xextern void ibm8514UnnaturalOpStipple() ; Xextern void ibm8514UnnaturalStipple() ; Xextern void ibm8514Stipple() ; Xextern void ibm8514OpStipple() ; X/* brcFont.o */ Xextern void ibm8514InitFontCache() ; Xextern Bool ibm8514RealizeFont() ; Xextern Bool ibm8514UnrealizeFont() ; X/* brcText.o */ Xextern int ibm8514PolyText8() ; Xextern int ibm8514PolyText16() ; Xextern void ibm8514ImageText8() ; Xextern void ibm8514ImageText16() ; X/* brcPoly.c */ Xextern int ibm8514SolidFillPoly() ; X/* brcPgon.o */ Xextern void ibm8514FillPolygon() ; X/* brcOutL.o */ Xextern void ibm8514Outline() ; X/* brcRect.o */ Xextern void ibm8514DrawRectangle() ; X/* brcTile.o */ Xextern void ibm8514TileRect() ; Xextern int ibm8514RotateTile() ; X/* brcPushPxl.o */ Xextern void ibm8514PushPixels() ; X/* brcOSD.o */ Xextern void ibm8514osdInit() ; Xextern int ibm8514Probe() ; Xextern void blockoutw() ; Xextern void blockinw() ; X#endif /* CURSOR_ONLY */ X#endif END-of-ibm8514/brcProcs.h echo x - ibm8514/brcPushPxl.c sed 's/^X//' >ibm8514/brcPushPxl.c << 'END-of-ibm8514/brcPushPxl.c' X/* X * Copyright IBM Corporation 1987,1990 X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of IBM not be X * used in advertising or publicity pertaining to distribution of the X * software without specific, written prior permission. X * X * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL X * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS X * SOFTWARE. X * X*/ X/* X * PRPQ 5799-PFF (C) COPYRIGHT IBM CORPORATION 1987,1990 X * LICENSED MATERIALS - PROPERTY OF IBM X * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083 X */ X/* X * ibm8514PushPixels X */ X#include "X.h" X#include "misc.h" X#include "gcstruct.h" X#include "scrnintstr.h" X#include "windowstr.h" X#include "regionstr.h" X#include "pixmapstr.h" X#include "miscstruct.h" X#include "maskbits.h" X X#include "OScompiler.h" X X#include "ppc.h" X X#include "x8514.h" Xextern int mfbGCPrivateIndex; X Xvoid Xibm8514PushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) X GCPtr pGC; X PixmapPtr pBitMap; X DrawablePtr pDrawable; X int dx, dy, xOrg, yOrg; X{ Xregister int thisX, thisY; XppcPrivGC *gcPriv = (ppcPrivGC *) ( pGC->devPrivates[mfbGCPrivateIndex].ptr ) ; Xint alu = gcPriv->colorRrop.alu; Xint fillstyle = gcPriv->colorRrop.fillStyle; XRegionPtr prgnDst ; XBoxPtr pbox ; Xunsigned int nbox ; Xint dxInWords, wInWords, i; Xunsigned char *data; XScreenPtr pScrn; X Xif (alu == GXnoop) X return; X Xif (dy > MONO_STAGE_SIZE) X { X ppcPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg); X return; X } X Xswitch (fillstyle) X { X break; X ppcPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg); X return; X ErrorF( "ibm8514PushPixels: Unknown fill Style\n" ) ; X return ; X } X X/* Find The Actual Regions To Fill X * by intersecting the destination's clip-region with X * the box defined by our arguments. X */ X{ X BoxRec dstBox ; X X dstBox.x2 = ( dstBox.x1 = xOrg ) + dx ; X dstBox.y2 = ( dstBox.y1 = yOrg ) + dy ; X X pScrn = (ScreenPtr) pDrawable->pScreen ; X X prgnDst = (* pScrn->RegionCreate )( &dstBox, X REGION_NUM_RECTS(gcPriv->pCompositeClip)) ; X (* pScrn->Intersect)( prgnDst, prgnDst, gcPriv->pCompositeClip ) ; X if ( !( nbox = REGION_NUM_RECTS(prgnDst) ) ) X { X (* pScrn->RegionDestroy )( prgnDst); X return ; X } X pbox = REGION_RECTS(prgnDst) ; X} X Xdx = MIN(dx,_8514_SCREEN_WIDTH); X XdxInWords = (dx+31) >> 5; XwInWords = (pBitMap->drawable.width + 31) >> 5; X Xif (dxInWords < wInWords) X { X /* fill the stage line by line */ X data = pBitMap->devPrivate.ptr; X for ( i = 0 ; i < dy ; i++ ) X { X /* since I know I'm one line high, I can lie about X end-of-line padding and use ByteAlign */ X ibm8514ByteAlignMonoImage(MONO_STAGE_WPLANE, GXcopy, X MONO_STAGE_X, MONO_STAGE_Y+i, X dx, 1, data); X data += pBitMap->devKind; X } X } X else X ibm8514AlignMonoImage(MONO_STAGE_WPLANE, GXcopy, X MONO_STAGE_X, MONO_STAGE_Y, X dx, dy, pBitMap->devPrivate.ptr ); X X/* OK, the bitmap is on the stage */ Xswitch (fillstyle) X { X for ( nbox = REGION_NUM_RECTS(prgnDst), pbox = REGION_RECTS(prgnDst) ; X nbox-- ; X pbox++ ) X { X thisX = pbox->x1; X thisY = pbox->y1; X ibm8514BlitFG(MONO_STAGE_RPLANE, X gcPriv->colorRrop.planemask, X gcPriv->colorRrop.fgPixel, alu, X MONO_STAGE_X + thisX - xOrg, X MONO_STAGE_Y + thisY - yOrg, X thisX, thisY, X pbox->x2 - thisX, X pbox->y2 - thisY ); X } X break; X ErrorF( X "ibm8514PushPixels: Serious Error. Unsupported fill Style\n" ) ; X break; X ErrorF( "ibm8514PushPixels: Unknown fill Style\n" ) ; X break; X } X(* pScrn->RegionDestroy )( prgnDst); Xreturn ; X} END-of-ibm8514/brcPushPxl.c exit