src/bitblt.c
/*****************************************************************************/
/**                                                                         **/
/**                             N_OP_pilotbitblt                            **/
/**                                                                         **/
/**       The Native-code compatible version of the opcode for bitblt.      **/
/**                                                                         **/
/**                                                                         **/
/*****************************************************************************/


The Native-code compatible version of the opcode for bitblt.
The Native - code compatible version of the opcode for bitblt .
LispPTR N_OP_pilotbitblt(LispPTR pilot_bt_tbl,int tos)
{
  PILOTBBT *pbt;
  DLword *srcbase, *dstbase;
#if defined(SUNDISPLAY) || defined(DOS)
  int displayflg;
#endif
  int sx, dx, w, h, srcbpl, dstbpl, backwardflg;
  int src_comp, op, gray, num_gray, curr_gray_line;
#ifdef INIT
  if (!kbd_for_makeinit) {
    init_keyboard(0);
    kbd_for_makeinit = 1;
  };
#endif
  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;
#ifdef DOS
  currentdsp->device.locked++;
#else
  ScreenLocked = T;
#endif 
#if SUNDISPLAY || DOS
  displayflg = cursorin(pbt->pbtdesthi, (pbt->pbtdestlo + (dx >> 4)), w, h, backwardflg) ||
               cursorin(pbt->pbtsourcehi, (pbt->pbtsourcelo + (sx >> 4)), w, h, backwardflg);
#endif 
  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;
#if   DOS
  if (displayflg) (currentdsp->mouse_invisible)(currentdsp, IOPage68K);
  ;
#endif 
  new_bitblt_code
#if   DOS
      flush_display_lineregion(dx, dstbase, w, h);
  if (displayflg) (currentdsp->mouse_visible)(IOPage68K->dlmousex, IOPage68K->dlmousey);
#endif 
#ifdef XWINDOW
  flush_display_lineregion(dx, dstbase, w, h);
#endif 
#ifdef DOS
  currentdsp->device.locked--;
#else
  ScreenLocked = NIL;
#endif 
  return (pilot_bt_tbl);
}
LispPTR N_OP_pilotbitblt ( LispPTR pilot_bt_tbl , int tos ) { PILOTBBT * pbt ; DLword * srcbase , * dstbase ; #if defined ( SUNDISPLAY ) || defined ( DOS ) int displayflg ; #endif int sx , dx , w , h , srcbpl , dstbpl , backwardflg ; int src_comp , op , gray , num_gray , curr_gray_line ; #ifdef INIT if ( ! kbd_for_makeinit ) { init_keyboard ( 0 ) ; kbd_for_makeinit = 1 ; } ; #endif 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 ; #ifdef DOS currentdsp -> device . locked ++ ; #else ScreenLocked = T ; #endif #if SUNDISPLAY || DOS displayflg = cursorin ( pbt -> pbtdesthi , ( pbt -> pbtdestlo + ( dx >> 4 ) ) , w , h , backwardflg ) || cursorin ( pbt -> pbtsourcehi , ( pbt -> pbtsourcelo + ( sx >> 4 ) ) , w , h , backwardflg ) ; #endif 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 ; #if DOS if ( displayflg ) ( currentdsp -> mouse_invisible ) ( currentdsp , IOPage68K ) ; ; #endif new_bitblt_code #if DOS flush_display_lineregion ( dx , dstbase , w , h ) ; if ( displayflg ) ( currentdsp -> mouse_visible ) ( IOPage68K -> dlmousex , IOPage68K -> dlmousey ) ; #endif #ifdef XWINDOW flush_display_lineregion ( dx , dstbase , w , h ) ; #endif #ifdef DOS currentdsp -> device . locked -- ; #else ScreenLocked = NIL ; #endif return ( pilot_bt_tbl ) ; }
N_OP_pilotbitblt
N_OP_pilotbitblt
/* 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 displayflg != 0 then source or destination is DisplayBitMap */ /* DOS */ /* SUNDISPLAY */ /* SUNDISPLAY / DOS */ /* SUNDISPLAY / DOS */ /* XWINDOW */ /* DOS */