1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-02 06:41:21 +00:00

Reformat all C source files with Clang-format in Google style w/ 100 col width.

This commit is contained in:
Nick Briggs
2017-05-28 18:08:18 -07:00
parent 691645d048
commit 156c3292f8
167 changed files with 40520 additions and 48069 deletions

262
src/bitblt.c Executable file → Normal file
View File

@@ -1,9 +1,7 @@
/* $Id: bitblt.c,v 1.2 1999/01/03 02:06:47 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved */
/* $Id: bitblt.c,v 1.2 1999/01/03 02:06:47 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved
*/
static char *id = "$Id: bitblt.c,v 1.2 1999/01/03 02:06:47 sybalsky Exp $ Copyright (C) Venue";
/************************************************************************/
/* */
/* (C) Copyright 1989-95 Venue. All Rights Reserved. */
@@ -18,7 +16,6 @@ static char *id = "$Id: bitblt.c,v 1.2 1999/01/03 02:06:47 sybalsky Exp $ Copyri
#include "version.h"
#include <stdio.h>
#ifndef NOPIXRECT
@@ -34,11 +31,10 @@ static char *id = "$Id: bitblt.c,v 1.2 1999/01/03 02:06:47 sybalsky Exp $ Copyri
#include <signal.h>
#endif
#ifdef XWINDOW
#ifdef XWINDOW
#define DISPLAYBUFFER
#endif /* XWINDOW */
#include "lispemul.h"
#include "lspglob.h"
#include "lispmap.h"
@@ -65,7 +61,6 @@ extern int kbd_for_makeinit;
extern int MonoOrColor;
#endif /* COLOR */
/*****************************************************************************/
/** **/
/** N_OP_pilotbitblt **/
@@ -75,114 +70,99 @@ extern int MonoOrColor;
/** **/
/*****************************************************************************/
LispPTR N_OP_pilotbitblt(pilot_bt_tbl, tos)
LispPTR pilot_bt_tbl;
int tos;
{
PILOTBBT *pbt;
DLword *srcbase, *dstbase;
int displayflg;
int sx, dx, w, h, srcbpl, dstbpl, backwardflg;
int src_comp, op, gray, num_gray, curr_gray_line;
LispPTR N_OP_pilotbitblt(pilot_bt_tbl, tos) LispPTR pilot_bt_tbl;
int tos;
{
PILOTBBT *pbt;
DLword *srcbase, *dstbase;
int displayflg;
int sx, dx, w, h, srcbpl, dstbpl, backwardflg;
int src_comp, op, gray, num_gray, curr_gray_line;
#ifdef INIT
/* for init, we have to initialize the pointers at the
first call to pilotbitblt or we die. If we do it
earlier we die also. We set a new flag so we don't
do it more than once which is a lose also.
/* for init, we have to initialize the pointers at the
first call to pilotbitblt or we die. If we do it
earlier we die also. We set a new flag so we don't
do it more than once which is a lose also.
I put this in an ifdef so there won't be any extra
code when making a regular LDE. */
if (!kbd_for_makeinit)
{
init_keyboard(0);
kbd_for_makeinit = 1;
};
I put this in an ifdef so there won't be any extra
code when making a regular LDE. */
if (!kbd_for_makeinit) {
init_keyboard(0);
kbd_for_makeinit = 1;
};
#endif
pbt = (PILOTBBT *)Addr68k_from_LADDR(pilot_bt_tbl);
pbt = (PILOTBBT *)Addr68k_from_LADDR(pilot_bt_tbl);
w = pbt->pbtwidth;
h = pbt->pbtheight;
if ((h <= 0) || (w <= 0)) return(pilot_bt_tbl);
dx = pbt->pbtdestbit;
sx = pbt->pbtsourcebit;
backwardflg = pbt->pbtbackward;
/* if displayflg != 0 then source or destination is DisplayBitMap */
w = pbt->pbtwidth;
h = pbt->pbtheight;
if ((h <= 0) || (w <= 0)) return (pilot_bt_tbl);
dx = pbt->pbtdestbit;
sx = pbt->pbtsourcebit;
backwardflg = pbt->pbtbackward;
/* if displayflg != 0 then source or destination is DisplayBitMap */
#ifdef DOS
currentdsp->device.locked++;
currentdsp->device.locked++;
#else
ScreenLocked = T;
ScreenLocked = T;
#endif /* DOS */
#if SUNDISPLAY || DOS
displayflg = cursorin(pbt->pbtdesthi, (pbt->pbtdestlo + (dx >> 4)),
w, h, backwardflg) ||
cursorin(pbt->pbtsourcehi, (pbt->pbtsourcelo + (sx >> 4)),
w, h, backwardflg);
displayflg = cursorin(pbt->pbtdesthi, (pbt->pbtdestlo + (dx >> 4)), w, h, backwardflg) ||
cursorin(pbt->pbtsourcehi, (pbt->pbtsourcelo + (sx >> 4)), w, h, backwardflg);
#endif /* SUNDISPLAY */
srcbase = (DLword *)Addr68k_from_LADDR(VAG2(pbt->pbtsourcehi, pbt->pbtsourcelo));
dstbase = (DLword *)Addr68k_from_LADDR(VAG2(pbt->pbtdesthi, pbt->pbtdestlo));
srcbase = (DLword *)Addr68k_from_LADDR( VAG2( pbt->pbtsourcehi,
pbt->pbtsourcelo));
dstbase = (DLword *)Addr68k_from_LADDR( VAG2( pbt->pbtdesthi,
pbt->pbtdestlo ));
srcbpl = pbt->pbtsourcebpl;
dstbpl = pbt->pbtdestbpl;
src_comp = pbt->pbtsourcetype;
op = pbt->pbtoperation;
gray = pbt->pbtusegray;
num_gray = ((TEXTUREBBT *)pbt)->pbtgrayheightlessone + 1;
curr_gray_line = ((TEXTUREBBT *)pbt)->pbtgrayoffset;
srcbpl = pbt->pbtsourcebpl;
dstbpl = pbt->pbtdestbpl;
src_comp = pbt->pbtsourcetype;
op = pbt->pbtoperation;
gray = pbt->pbtusegray;
num_gray = ((TEXTUREBBT *)pbt)->pbtgrayheightlessone + 1;
curr_gray_line = ((TEXTUREBBT *)pbt)->pbtgrayoffset;
#ifdef SUNDISPLAY
if( displayflg ) HideCursor;
if (displayflg) HideCursor;
#elif DOS
if( displayflg ) (currentdsp->mouse_invissible)( currentdsp, IOPage68K );;
if (displayflg) (currentdsp->mouse_invissible)(currentdsp, IOPage68K);
;
#endif /* SUNDISPLAY / DOS */
new_bitblt_code
new_bitblt_code
#ifdef SUNDISPLAY
#ifdef DISPLAYBUFFER
#ifdef COLOR
if( MonoOrColor == MONO_SCREEN )
if (MonoOrColor == MONO_SCREEN)
#endif /* COLOR */
if (in_display_segment(dstbase))
flush_display_lineregion(dx, dstbase, w, h);
if (in_display_segment(dstbase)) flush_display_lineregion(dx, dstbase, w, h);
#endif
if( displayflg) ShowCursor;
if (displayflg) ShowCursor;
#elif DOS
flush_display_lineregion(dx, dstbase, w, h);
if( displayflg) (currentdsp->mouse_vissible)( IOPage68K->dlmousex,
IOPage68K->dlmousey );
flush_display_lineregion(dx, dstbase, w, h);
if (displayflg) (currentdsp->mouse_vissible)(IOPage68K->dlmousex, IOPage68K->dlmousey);
#endif /* SUNDISPLAY / DOS */
#ifdef XWINDOW
flush_display_lineregion(dx, dstbase, w, h);
flush_display_lineregion(dx, dstbase, w, h);
#endif /* XWINDOW */
#ifdef DOS
currentdsp->device.locked--;
currentdsp->device.locked--;
#else
ScreenLocked = NIL;
ScreenLocked = NIL;
#endif /* DOS */
return(pilot_bt_tbl);
} /* end of N_OP_pilotbitblt */
return (pilot_bt_tbl);
} /* end of N_OP_pilotbitblt */
/************************************************************************/
/* */
@@ -194,82 +174,74 @@ LispPTR N_OP_pilotbitblt(pilot_bt_tbl, tos)
#ifndef COLOR
/* for MONO only */
int cursorin (addrhi, addrlo, w, h, backward)
DLword addrhi; /* Lisp addr hi-word */
DLword addrlo; /* Lisp addr lo-word */
register int w, h;
{
register int x, y;
if (addrhi == DISPLAY_HI)
{
y = addrlo / DisplayRasterWidth;
x = (addrlo - y * DisplayRasterWidth) << 4;
}
else if (addrhi == DISPLAY_HI+1)
{
y = (addrlo + DLWORDSPER_SEGMENT) / DisplayRasterWidth;
x = ((addrlo + DLWORDSPER_SEGMENT) - y * DisplayRasterWidth) << 4;
}
else return( NIL );
int cursorin(addrhi, addrlo, w, h, backward) DLword addrhi; /* Lisp addr hi-word */
DLword addrlo; /* Lisp addr lo-word */
register int w, h;
{
register int x, y;
if (addrhi == DISPLAY_HI) {
y = addrlo / DisplayRasterWidth;
x = (addrlo - y * DisplayRasterWidth) << 4;
} else if (addrhi == DISPLAY_HI + 1) {
y = (addrlo + DLWORDSPER_SEGMENT) / DisplayRasterWidth;
x = ((addrlo + DLWORDSPER_SEGMENT) - y * DisplayRasterWidth) << 4;
} else
return (NIL);
if(backward) y -= h;
if((x < MOUSEXR)&&(x + w > MOUSEXL)&&(y < MOUSEYH)&&(y + h > MOUSEYL))
return( T );
else return( NIL );
}
if (backward) y -= h;
if ((x < MOUSEXR) && (x + w > MOUSEXL) && (y < MOUSEYH) && (y + h > MOUSEYL))
return (T);
else
return (NIL);
}
#else
/* for COLOR & MONO */
int cursorin (addrhi, addrlo, w, h, backward)
DLword addrhi; /* Lisp addr hi-word */
DLword addrlo; /* Lisp addr lo-word */
register int w, h;
{
register int x, y;
register DLword *base68k;
extern int MonoOrColor;
extern int displaywidth;
extern DLword *ColorDisplayRegion68k;
int cursorin(addrhi, addrlo, w, h, backward) DLword addrhi; /* Lisp addr hi-word */
DLword addrlo; /* Lisp addr lo-word */
register int w, h;
{
register int x, y;
register DLword *base68k;
extern int MonoOrColor;
extern int displaywidth;
extern DLword *ColorDisplayRegion68k;
if(MonoOrColor == MONO_SCREEN) { /* On MONO screen */
if (addrhi == DISPLAY_HI)
{
y = addrlo / DisplayRasterWidth;
x = (addrlo - y * DisplayRasterWidth) << 4;
}
else if (addrhi == DISPLAY_HI+1)
{
y = (addrlo + DLWORDSPER_SEGMENT) / DisplayRasterWidth;
x = ((addrlo + DLWORDSPER_SEGMENT) - y * DisplayRasterWidth) << 4;
}
else return( NIL );
if (MonoOrColor == MONO_SCREEN) { /* On MONO screen */
if (addrhi == DISPLAY_HI) {
y = addrlo / DisplayRasterWidth;
x = (addrlo - y * DisplayRasterWidth) << 4;
} else if (addrhi == DISPLAY_HI + 1) {
y = (addrlo + DLWORDSPER_SEGMENT) / DisplayRasterWidth;
x = ((addrlo + DLWORDSPER_SEGMENT) - y * DisplayRasterWidth) << 4;
} else
return (NIL);
if(backward) y -= h;
if((x < MOUSEXR)&&(x + w > MOUSEXL)&&(y < MOUSEYH)&&(y + h > MOUSEYL))
return( T );
else
return( NIL );
}
else {
base68k=(DLword*)Addr68k_from_LADDR(addrhi << 16 | addrlo);
if ((ColorDisplayRegion68k<=base68k) &&
(base68k <= COLOR_MAX_Address)){
y =(base68k - ColorDisplayRegion68k) /displaywidth ;
x = (UNSIGNED)(base68k - ColorDisplayRegion68k) -(y * displaywidth );
/* printf("cursorin: IN COLOR mx=%d my=%d x=%d y%d w=%d h=%d\n"
,*EmMouseX68K,*EmMouseY68K,x,y,w,h); */
}
else return( NIL );
if (backward) y -= h;
if(backward) y -= h;
if ((x < MOUSEXR) && (x + w > MOUSEXL) && (y < MOUSEYH) && (y + h > MOUSEYL))
return (T);
else
return (NIL);
} else {
base68k = (DLword *)Addr68k_from_LADDR(addrhi << 16 | addrlo);
if ((ColorDisplayRegion68k <= base68k) && (base68k <= COLOR_MAX_Address)) {
y = (base68k - ColorDisplayRegion68k) / displaywidth;
x = (UNSIGNED)(base68k - ColorDisplayRegion68k) - (y * displaywidth);
/* printf("cursorin: IN COLOR mx=%d my=%d x=%d y%d w=%d h=%d\n"
,*EmMouseX68K,*EmMouseY68K,x,y,w,h); */
} else
return (NIL);
if((x < MOUSEXR)&&((x + (w >> 3)) > MOUSEXL)&&(y < MOUSEYH)&&(y + h > MOUSEYL))
{ /* printf("cursorin T\n"); */ return( T );}
else
return( NIL );
if (backward) y -= h;
} /* on COLOR screen */
}
if ((x < MOUSEXR) && ((x + (w >> 3)) > MOUSEXL) && (y < MOUSEYH) &&
(y + h > MOUSEYL)) { /* printf("cursorin T\n"); */
return (T);
} else
return (NIL);
} /* on COLOR screen */
}
#endif /* COLOR */