static int ReadImageDesc (MG_RWops *area, IMAGEDESC* ImageDesc, GIFSCREEN* GifScreen)
{
    unsigned char buf[16];
    if (!ReadOK (area, buf, 9)) {
        _MG_PRINTF ("EX_CTRL>GIF89a: bad image size\n");
        return -1;
    }

    ImageDesc->Top = LM_to_uint (buf[0], buf[1]);
    ImageDesc->Left = LM_to_uint (buf[2], buf[3]);
    ImageDesc->Width = LM_to_uint (buf[4], buf[5]);
    ImageDesc->Height = LM_to_uint (buf[6], buf[7]);
    ImageDesc->haveColorMap = BitSet (buf[8], LOCALCOLORMAP);

    ImageDesc->bitPixel = 1 << ((buf[8] & 0x07) + 1);

    ImageDesc->interlace = BitSet(buf[8], INTERLACE);

    if (ImageDesc->haveColorMap) {
        _MG_PRINTF ("EX_CTRL>GIF89a: have local colormap\n");
        if (ReadColorMap (area, ImageDesc->bitPixel, ImageDesc->ColorMap) < 0) {
            _MG_PRINTF ("EX_CTRL>GIF89a: bad local colormap\n");
            return -1;
        }
    } else {
        memcpy (ImageDesc->ColorMap, GifScreen->ColorMap, MAXCOLORMAPSIZE*sizeof (RGB));
    }

    return 0;
}
Ejemplo n.º 2
0
	void SingleDataChecker::check(const QString& path, const Torrent& tor,const QString &)
	{
		// open the file
		Uint32 num_chunks = tor.getNumChunks();
		Uint32 chunk_size = tor.getChunkSize();
		File fptr;
		if (!fptr.open(path,"rb"))
		{
			throw Error(i18n("Cannot open file : %1 : %2")
					.arg(path).arg( fptr.errorString()));
		}

		// initialize the bitsets
		downloaded = BitSet(num_chunks);
		failed = BitSet(num_chunks);
		
		TimeStamp last_update_time = bt::GetCurrentTime();
		
		// loop over all chunks
		Array<Uint8> buf(chunk_size);
		for (Uint32 i = 0;i < num_chunks;i++)
		{
			if (listener)
			{
				listener->progress(i,num_chunks);
				if (listener->needToStop()) // if we need to stop just return
					return;
			}
			
			TimeStamp now = bt::GetCurrentTime();
			if (now - last_update_time > 1000)
			{
				Out(SYS_DIO|LOG_DEBUG) << "Checked " << i << " chunks" << endl;
				last_update_time = now;
			}
	
			if (!fptr.eof())
			{
				// read the chunk
				Uint32 size = i == num_chunks - 1 && tor.getFileLength() % tor.getChunkSize() > 0 ?
						tor.getFileLength() % tor.getChunkSize() : (Uint32)tor.getChunkSize();
				
				fptr.seek(File::BEGIN,(Int64)i*tor.getChunkSize());
				fptr.read(buf,size);
				// generate and test hash
				SHA1Hash h = SHA1Hash::generate(buf,size);
				bool ok = (h == tor.getHash(i));
				downloaded.set(i,ok);
				failed.set(i,!ok);
			}
			else
			{
				// at end of file so set to default values for a failed chunk
				downloaded.set(i,false);
				failed.set(i,true);
			}
			if (listener)
				listener->status(failed.numOnBits(),downloaded.numOnBits());
		}
	}
Ejemplo n.º 3
0
	bool ChunkDownload::load(File & file,ChunkDownloadHeader & hdr)
	{
		// read pieces
		if (hdr.num_bits != num)
			return false; 
		
		pieces = BitSet(hdr.num_bits);
		Array<Uint8> data(pieces.getNumBytes());
		file.read(data,pieces.getNumBytes());
		pieces = BitSet(data,hdr.num_bits);
		num_downloaded = pieces.numOnBits();
		if (hdr.buffered)
		{
			// if it's a buffered chunk, load the data to
			if (file.read(chunk->getData(),chunk->getSize()) != chunk->getSize())
				return false;
		}
		
		for (Uint32 i = 0;i < pieces.getNumBits();i++)
			if (pieces.get(i))
				piece_queue.remove(i);
		
		updateHash();
		return true;
	}
Ejemplo n.º 4
0
/*
 * Set the bit string.
 *	Set the width bits from the position of specified bit.
 */
EXPORT void BitsSet( VP base, W offset, W width )
{
    UB	*bp;
    INT	n;

    n = offset / TSD_BST_N_8;
    bp = (UB*)base + n;

    n = (W)((UW)offset & TSD_BST_MSK_7);
    if ( n > 0 ) {
        for ( ; n < TSD_BST_N_8; ++n ) {
            if ( --width < 0 ) {
                return;
            }
            BitSet(bp, (UW)n);
        }
        bp++;
    }

    n = width / TSD_BST_N_8;
    if ( n > 0 ) {
        memset(bp, TSD_BST_VAL_0XFF, (size_t)n);
    }
    bp += n;
    width -= n * TSD_BST_N_8;

    for ( n = 0; n < width; ++n ) {
        BitSet(bp, (UW)n);
    }
}
Ejemplo n.º 5
0
BitSet* ChainedFilter::bits( IndexReader* reader, int logic )
{
	BitSet* bts = NULL;
	
	Filter** filter = filters;
	
	// see discussion at top of file
	if( *filter ) {
		BitSet* tmp = (*filter)->bits( reader );
		if ( (*filter)->shouldDeleteBitSet(tmp) ) //if we are supposed to delete this BitSet, then 
			bts = tmp; //we can safely call it our own
		else if ( tmp == NULL ){
			int32_t len = reader->maxDoc();
			bts = _CLNEW BitSet( len ); //bitset returned null, which means match _all_
			for (int32_t i=0;i<len;i++ )
				bts->set(i);
		}else{
			bts = tmp->clone(); //else it is probably cached, so we need to copy it before using it.
		}
		filter++;
	}
	else
		bts = _CLNEW BitSet( reader->maxDoc() );
	
	while( *filter ) {
		doChain( bts, reader, logic, *filter );
		filter++;
	}
	
	return bts;
}
Ejemplo n.º 6
0
/*
 * Set the bit string.
 *	Set the width bits from the position of specified bit.
 */
EXPORT void BitsSet( void *base, W offset, W width )
{
    UB	*bp;
    INT	n;

    n = offset / 8;
    bp = (UB*)base + n;

    n = (W)((UW)offset & 7U);
    if ( n > 0 ) {
        for ( ; n < 8; ++n ) {
            if ( --width < 0 ) {
                return;
            }
            BitSet(bp, (UW)n);
        }
        bp++;
    }

    n = width / 8;
    if ( n > 0 ) {
        MEMSET(bp, 0xffU, (size_t)n);
    }
    bp += n;
    width -= n * 8;

    for ( n = 0; n < width; ++n ) {
        BitSet(bp, (UW)n);
    }
}
Ejemplo n.º 7
0
//==================================================================================
void SetPopSub(U8 _pth, U8 _pos_x, U8 _pos_y, U8 _lngth, U8 _hght, U8 _main_mn_pos_crnt)
{
//	_lngth = 0;			//... temporal
//	_hght = 0;			//... temporal
	CreateBoxPopFrame(_pth,BOX_POP_SB,_pos_x,_pos_y,_lngth,_hght);
//	IfBitSet(_pth,PTH_X)	SetPopSubOSD(PTH_X,_pos_x,_pos_y, _main_mn_pos_crnt);
//	IfBitSet(_pth,PTH_Y)	SetPopSubOSD(PTH_Y,_pos_x,_pos_y, _main_mn_pos_crnt);
	if(BitSet(_pth,PTH_X))	SetPopSubOSD(PTH_X,_pos_x,_pos_y, _main_mn_pos_crnt);
	if(BitSet(_pth,PTH_Y))	SetPopSubOSD(PTH_Y,_pos_x,_pos_y, _main_mn_pos_crnt);
}
Ejemplo n.º 8
0
//==================================================================================
void SetPopMain(U8 _pth, U8 _pos_x, U8 _pos_y, U8 _lngth, U8 _hght)
{
//	_lngth = 0;			//... temporal
//	_hght = 0;			//... temporal
	CreateBoxPopFrame(_pth,BOX_POP_MN,_pos_x,_pos_y,_lngth,_hght);
//	IfBitSet(_pth,PTH_X)	SetPopMainOSD(PTH_X,_pos_x,_pos_y);
//	IfBitSet(_pth,PTH_Y)	SetPopMainOSD(PTH_Y,_pos_x,_pos_y);
	if(BitSet(_pth,PTH_X))	SetPopMainOSD(PTH_X,_pos_x,_pos_y);
	if(BitSet(_pth,PTH_Y))	SetPopMainOSD(PTH_Y,_pos_x,_pos_y);
}
Ejemplo n.º 9
0
int bitmanip(int word)
{
printf("fresh %d\n",word);
      word = BitSet(word, 2);
printf("set 2 %d\n",word);
      word = BitSet(word, 7);
printf("set 7 %d\n",word);
      word = BitClr(word, 3);
printf("clr 3 %d\n",word);
      word = BitFlp(word, 9);
printf("flip 9 %d\n",word);
      return word;
}
Ejemplo n.º 10
0
void SetObjectVisible (ObjectRecHdl ObjectHdl, Boolean VisibleFlag)
{
	short	objectFlags;
	
	objectFlags = (**ObjectHdl).objectFlags;
	if (VisibleFlag)
		BitSet (&objectFlags, kVisibleMask);
	else
		BitSet (&objectFlags, kVisibleMask);
	(**ObjectHdl).objectFlags = objectFlags;

	return;
}
Ejemplo n.º 11
0
Archivo: box.c Proyecto: zonesan/ucos
//==================================================================================
//						Box function description
//==================================================================================
//void SetBox3DEffect(U8 tgl_dim, U8 tgl_emp)
//{
//	U8	r_box_mode;
//	
//	r_box_mode = ReadAsicByte(MASTER,DVC_PG2,REG_BOX_MODE);
//	if(tgl_dim == ON)	SetBit(r_box_mode,BOX_TYPE);
//	else	ClearBit(r_box_mode,BOX_TYPE);
//	if(tgl_emp == ON)	SetBit(r_box_mode,BOX_EMP);
//	else	ClearBit(r_box_mode,BOX_EMP);
//	WriteAsicByte(MASTER,DVC_PG2,REG_BOX_MODE,r_box_mode);
//}
////==================================================================================
//void SetBoxPlaneCol(U8 _box_strt, U8 _box_end, U8 _col)
//{
//	U8	_rdat_;
//	U8	_t1_, _t2_;
//
//	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++){
//		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCOL10+(_t1_>>1));
//		_t2_ = (_t1_&0x01)<<2;														//... _t2_ = 0 or _t2_ = 4
//		_rdat_ = (_rdat_ & (0xf0>>_t2_))|_col<<_t2_;
//		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCOL10+(_t1_>>1),_rdat_);
//	}
//}
////==================================================================================
//void SetBoxPlane(U8 _box_strt, U8 _box_end, U8 tgl_pln)
//{
//	U8	_rdat_;
//	U8 _t1_;
//	
//	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++){
//		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_);
//		if(tgl_pln == ON)	SetBit(_rdat_,BOX_PLN_EN);
//		else	ClearBit(_rdat_,BOX_PLN_EN);
//		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_,_rdat_);
//	}
//}
////==================================================================================
//void EnableBox(U8 _pth, U8 _box_num)//U8 _box_strt, U8 _box_end)
//{
////	U8	_rdat_;
////	U8 _t1_=0;
////
////	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++){
////		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_);
////		ClearBit(_rdat_,BOX_EN_X|BOX_EN_Y);
////		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_,_pth|_rdat_);
////	}
//
//	if(BitSet(_pth,PTH_X))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT0,BIT0);
//	if(BitSet(_pth,PTH_Y))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT3,BIT3);
//}
////==================================================================================
void DisableBox(U8 _pth, U8 _box_num)//, U8 _box_strt, U8 _box_end)
{
//	U8	_rdat_;
//	U8 _t1_;
//
//	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++){
//		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_);
//		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_,(~ _pth) & _rdat_);
//	}

	if(BitSet(_pth,PTH_X))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT1|BIT0,0x00);
	if(BitSet(_pth,PTH_Y))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT4|BIT3,0x00);
}
Ejemplo n.º 12
0
Archivo: box.c Proyecto: zonesan/ucos
//==================================================================================
void SetBoxPln(U8 _pth, U8 _box_num, U8 _tgl)//U8 _box_strt, U8 _box_end
{
//	U8	_rdat_
//	U8 _t1_=0
//
//	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++)
//		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_)
//		ClearBit(_rdat_,BOX_EN_X|BOX_EN_Y)
//		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_,_pth|_rdat_)
//	

	if(BitSet(_pth,PTH_X))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT0,_tgl);
	if(BitSet(_pth,PTH_Y))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT3,_tgl<<3);
}
Ejemplo n.º 13
0
Archivo: box.c Proyecto: zonesan/ucos
//==================================================================================
void SetBoxMix(U8 _pth, U8 _box_num, U8 _tgl)//U8 _box_strt, U8 _box_end, U8 tgl_ht)
{
//	U8	_rdat_;
//	U8	_t1_;
//
//	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++){
//		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_);
//		if(tgl_ht == ON)	SetBit(_rdat_,BOX_PLN_MIX);
//		else	ClearBit(_rdat_,BOX_PLN_MIX);
//		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_,_rdat_);
//	}
	if(BitSet(_pth,PTH_X))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT2,_tgl<<2);
	if(BitSet(_pth,PTH_Y))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT5,_tgl<<5);
}
Ejemplo n.º 14
0
//--------------------------------------------------------------------------------//
void LCD_NYB(unsigned char nyb,unsigned char type){
    //SEND DATA LINE THE INFO 
    LCD_PORT->BSRRH |= 0x0F;
    LCD_PORT->BSRRL |= (nyb & 0x0F);

    if(type == CMD){
        BitClr(LCD_RS);             //COMMAND MODE
    } else {
        BitSet(LCD_RS);             //CHARACTER/DATA MODE
    }

    BitSet(LCD_E);         //ENABLE LCD DATA LINE
    DelayMS(1);                 //SMALL DELAY
    BitClr(LCD_E);         //DISABLE LCD DATA LINE
}
Ejemplo n.º 15
0
Archivo: box.c Proyecto: zonesan/ucos
//==================================================================================
void SetBoxPos(U8 _box_num, U16 _boxhl, U16 _boxvt)
{
	U8	_rdat_;

	_rdat_ = ReadAsicByte(MASTER,DVC_PG2,0x21+_box_num*6);

	if(BitSet(_boxhl, BIT0))	SetBit(_rdat_, BIT3);
	else	ClearBit(_rdat_, BIT3);
	if(BitSet(_boxvt, BIT0))	SetBit(_rdat_, BIT1);
	else	ClearBit(_rdat_, BIT1);

	WriteAsicByte(MASTER,DVC_PG2,0x21+_box_num*6,_rdat_);
	WriteAsicByte(MASTER,DVC_PG2,0x22+_box_num*6,(U8)(_boxhl>>1));
	WriteAsicByte(MASTER,DVC_PG2,0x24+_box_num*6,(U8)(_boxvt>>1));
}
Ejemplo n.º 16
0
Archivo: box.c Proyecto: zonesan/ucos
//==================================================================================
void SetBoxBnd(U8 _pth, U8 _box_num, U8 _tgl)//U8 _box_strt, U8 _box_end, U8 boundary)
{	//... single box boundary is generated same as channel boundary structure.
	//... that is, boxhl/boxvt is inside of box area, boxhw/boxvw is outside of box area.
//	U8	_rdat_;
//	U8	_t1_;
//
//	for(_t1_ = _box_strt ; _t1_ <= _box_end ; _t1_++){
//		_rdat_ = ReadAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_);
//		ClearBit(_rdat_,(BOX_OBND|BOX_IBND));
//		WriteAsicByte(MASTER,DVC_PG2,REG_BOXCTL+5*_t1_,_rdat_|boundary);
//	}

	if(BitSet(_pth,PTH_X))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT1,_tgl<<1);
	if(BitSet(_pth,PTH_Y))	SetAsicFlgType(MASTER,DVC_PG2,0x20+_box_num*6,BIT4,_tgl<<4);
}
Ejemplo n.º 17
0
// Fairness Checker implementation
FairnessChecker::FairnessChecker(const LTSFairSetRef& FairSet,
                                 SystemIndexSet* SysIdxSet,
                                 const vector<GCmdRef>& GuardedCommands,
                                 LTSChecker* Checker)
    : Enabled(false), Disabled(false), Executed(false),
      FairSet(FairSet), NumInstances(FairSet->GetNumInstances()),
      IsStrong(FairSet->GetFairnessType() == FairSetFairnessType::Strong),
      SysIdxSet(SysIdxSet), ClassID(FairSet->GetClassID()),
      GCmdsToRespondTo(NumInstances, BitSet(GuardedCommands.size(), false)),
      GCmdIDsToRespondTo(NumInstances),
      Checker(Checker),
      EnabledPerInstance(NumInstances, false),
      ExecutedPerInstance(NumInstances, false),
      DisabledPerInstance(NumInstances, false),
      SatisfiedInTrace(NumInstances, false)
{
    for (u32 Instance = 0; Instance < NumInstances; ++Instance) {
        const u32 NumGuardedCommands = GuardedCommands.size();
        for (u32 i = 0; i < NumGuardedCommands; ++i) {
            auto const& Cmd = GuardedCommands[i];
            auto const& FairObjs = Cmd->GetFairnessObjsSatisfied();
            for (auto const& FairObj : FairObjs) {
                if (FairObj->GetFairnessSet() == FairSet &&
                    FairObj->GetInstanceNumber() == Instance) {
                    GCmdsToRespondTo[Instance].Set(i);
                    GCmdIDsToRespondTo[Instance].insert(i);
                }
            }
        }
    }
}
Ejemplo n.º 18
0
BronKerbosch::BronKerbosch(const Graph& g)
  : _g(g)
  , _n(static_cast<size_t>(lemon::countNodes(_g)))
  , _cliques()
  , _bitToNode()
  , _nodeToBit(g, std::numeric_limits<size_t>::max())
  , _bitNeighborhood(g, BitSet(_n))
{
  // initialize mappings
  _bitToNode.reserve(_n);
  size_t i = 0;
  for (NodeIt v(_g); v != lemon::INVALID; ++v, ++i)
  {
    _bitToNode.push_back(v);
    _nodeToBit[v] = i;
  }

  // initialize neighborhoods
  for (NodeIt v(_g); v != lemon::INVALID; ++v, ++i)
  {
    BitSet& neighborhood = _bitNeighborhood[v];
    for (IncEdgeIt e(_g, v); e != lemon::INVALID; ++e)
    {
      Node w = _g.oppositeNode(v, e);
      neighborhood[_nodeToBit[w]] = 1;
    }
  }
}
Ejemplo n.º 19
0
void RFM70_CE(uint8_t state)
{
    if(state==0)
        BitClr(PORTD,(1<<PD4));
    else
        BitSet(PORTD,(1<<PD4));
}
Ejemplo n.º 20
0
void RFM70_MOSI(uint8_t state)
{
    if(state==0)
        BitClr(PORTB,(1<<PB3));
    else
        BitSet(PORTB,(1<<PB3));
}
Ejemplo n.º 21
0
void RFM70_SCK(uint8_t state)
{
    if(state==0)
        BitClr(PORTB,(1<<PB5));
    else
        BitSet(PORTB,(1<<PB5));
}
Ejemplo n.º 22
0
Command::Command()
{
    _name = "";
    _subcmd=0;
    _type = CommandType::Misc;
    _access = BitSet(0, RANK_PLAYER);
    _position = POSITION::any;
}
Ejemplo n.º 23
0
/** Returns a BitSet with true for documents which should be permitted in
search results, and false for those that should not. */
BitSet* QueryFilter::bits( IndexReader* reader )
{
    BitSet* bits = _CLNEW BitSet(reader->maxDoc());

	IndexSearcher s(reader);
	QFHitCollector hc(bits);
	s._search(query, NULL, &hc);
    return bits;
}
Ejemplo n.º 24
0
Archivo: box.c Proyecto: zonesan/ucos
//==================================================================================
void SetBoxSize(U8 _box_num, U16 _boxhw, U16 _boxvw)
{
//	WriteAsicByte(MASTER,DVC_PG2,REG_BOXHW+5*_box_num,_boxhw);
//	WriteAsicByte(MASTER,DVC_PG2,REG_BOXVW+5*_box_num,_boxvw);

	U8	_rdat_;

	_rdat_ = ReadAsicByte(MASTER,DVC_PG2,0x21+_box_num*6);

	if(BitSet(_boxhw, BIT0))	SetBit(_rdat_, BIT2);
	else	ClearBit(_rdat_, BIT2);
	if(BitSet(_boxvw, BIT0))	SetBit(_rdat_, BIT0);
	else	ClearBit(_rdat_, BIT0);

	WriteAsicByte(MASTER,DVC_PG2,0x21+_box_num*6,_rdat_);
	WriteAsicByte(MASTER,DVC_PG2,0x23+_box_num*6,(U8)(_boxhw>>1));
	WriteAsicByte(MASTER,DVC_PG2,0x25+_box_num*6,(U8)(_boxvw>>1));
}
Ejemplo n.º 25
0
static boolean meallocmenuid (short *id) {
	
	/*
	12/27/96 dmb: windows port
	*/

	register short i;
	register hdlmenubarlist hlist = menubarlist;
	register byte *pbitmap;
	boolean	flFound = false;
	#ifdef MACVERSION
		//9/1/00 Timothy Paustian
		//got rid of nasty use of direct memory access.
		//not allowed in carbon
		#if TARGET_API_MAC_CARBON == 1
		MenuBarHandle MenuList = nil;
		MenuList = GetMenuBar();
		#else
		#define MenuList (*(Handle *)0xA1C)
		#endif		
	#endif

	if (hlist == nil)
		return (false);
	
	pbitmap = (**hlist).menubitmap;
	
	for (i = 0; i < maxmenus; i++) {
		
		if (!BitTst (pbitmap, i)) { /*found one not in use*/
			
			BitSet (pbitmap, i);
			
			*id = (**hlist).basemenuid + i;
			
			#ifdef MACVERSION
				if ((MenuList != nil) && (GetMenuHandle (*id) != nil)) /*2.1a6 dmb: in use by someone!*/
					continue;
			#endif
			
			#ifdef WIN95VERSION
				*id *= 100; // 4.18.97 dmb: leave room for 99 items with their own, sequenced ids
			#endif
			
			flFound = true;
			break;
			}
		} /*for*/
	#if MACVERSION && TARGET_API_MAC_CARBON
		//Code change by Timothy Paustian Tuesday, September 5, 2000 9:27:35 PM
		//Only dispose of in carbon
		if(MenuList != nil)
			DisposeMenuBar(MenuList);
	#endif
	return (flFound); /*all menu ids are in use*/
	} /*meallocmenuid*/
Ejemplo n.º 26
0
void InicializaSerial(void)
{
	TXSTA = 0b00101100;	//configura a transmissão de dados da serial
	RCSTA = 0b10010000;	//configura a recepção de dados da serial
	BAUDCON = 0b00001000;	//configura sistema de velocidade da serial
	SPBRGH = 0b00000000;	//configura para 56k
	SPBRG = 0b00100010;	//configura para 56k
	BitSet(TRISC,6);	//pino de recepção de dados
	BitClr(TRISC,7);	//pino de envio de dados
}
Ejemplo n.º 27
0
	MetadataDownload::MetadataDownload(UTMetaData* ext, Uint32 size) : ext(ext),total_size(size)
	{
		metadata.resize(size);
		Uint32 num_pieces = size / METADATA_PIECE_SIZE;
		if (size % METADATA_PIECE_SIZE > 0)
			num_pieces++;
		
		pieces = BitSet(num_pieces);
		download(0);
	}
Ejemplo n.º 28
0
//==================================================================================
//						Popup function description
//==================================================================================
void SetPopMainOSD(U8 _pth, U8 _pos_x, U8 _pos_y)
{
	if(BitSet(_pth,PTH_X)){
		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_DS,0x00,str_wndw_pop_ds_sb);
//#if defined(__4CH__)
//		if((wndw_ds_sc_fmt == SC_FMT_4CH)&&(b_ds_wth_4pb))
//#elif defined(__16CH__)
//		if((wndw_ds_sc_fmt == SC_FMT_16CH)&&(b_ds_wth_16pb))
//#endif
//			WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_CH,OSD_MIX,str_wndw_pop_ch);
//		else
//			WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_CH,0x00,str_wndw_pop_ch);
//		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_ZM,0x00,str_wndw_pop_zm);
		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_RC,0x00,str_wndw_pop_rc);
		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_MTN,0x00,str_wndw_pop_mtn);
#if defined(__WTH_ADO__)
		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_ADO,0x00,str_wndw_pop_ado);
#elif defined(__WTH_VGA__)
		if(cmn_vga_det)
			WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_VGA,0x00,str_wndw_pop_vga);
#endif
//		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_RG,0x00,str_wndw_pop_rg);
		WriteOSDStrY(MASTER,_pos_x,_pos_y+(POP_POS_RG+cmn_vga_det),0x00,str_wndw_pop_rg);
//		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_ABT,0x00,str_wndw_pop_abt);
	}
	if(BitSet(_pth,PTH_Y)){
		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_DS,0x00,str_wndw_pop_ds);
//		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_CH,OSD_MIX,str_wndw_pop_ch);  
//		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_ZM,OSD_MIX,str_wndw_pop_zm);
		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_RC,0x00,str_wndw_pop_rc_sb);
		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_MTN,OSD_MIX,str_wndw_pop_mtn);
#if defined(__WTH_ADO__)
		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_ADO,0x00,str_wndw_pop_ado);
#elif defined(__WTH_VGA__)
		if(cmn_vga_det)
			WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_VGA,0x00,str_wndw_pop_vga);
#endif
//		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_RG,0x00,str_wndw_pop_rg);
		WriteOSDStrY(MASTER,_pos_x,_pos_y+(POP_POS_RG+cmn_vga_det),0x00,str_wndw_pop_rg);
//		WriteOSDStrY(MASTER,_pos_x,_pos_y+POP_POS_ABT,0x00,str_wndw_pop_abt);
	}
}
Ejemplo n.º 29
0
void Permute(EncryptBlk *aBlkPTr, int32_t* aKeyPtr)
{
	register char bitPos;
	char* ArrayPtr;

	register uint32_t	keyLo;
	register uint32_t	keyHi;
	register uint32_t	loBits;
	register uint32_t	hiBits;
	register uint32_t	gTestVal;
	register uint32_t	gTemp;
	register uint32_t	arrayByte;

	bitPos = 0;
	hiBits = 0;
	loBits = 0;

	keyLo = aBlkPTr->keyLo;
	keyHi = aBlkPTr->keyHi;

	ArrayPtr = (char*) aKeyPtr;
	bitPos = *ArrayPtr ++; 		/* get source bit */

Loop:
	arrayByte = bitPos;
	ROLeftLong(hiBits);

	BitTest(5, arrayByte);
	BEQ(jump20);

	BitClear(5,arrayByte);
	BitTest(arrayByte,keyLo);
	BNE(jump30);
	BRA(jump40);
		
jump20:
	BitTest(arrayByte,keyHi);
	BEQ(jump40);	
		
jump30:
	BitSet(kbit0,hiBits);

jump40:
	bitPos = *ArrayPtr++;
	if (bitPos >= 0) goto Loop;
	EXchange(hiBits,loBits);
	if ( bitPos !=  -1 ) goto jump50;
	bitPos = *ArrayPtr++;
	goto Loop;
		
jump50:
	aBlkPTr->keyLo = loBits; /* low bits */
	aBlkPTr->keyHi = hiBits;
}
Ejemplo n.º 30
0
void IntEnable(u8 numinter)
{
    #if defined(UBW32_795) || defined(EMPEROR795) || defined(PIC32_PINGUINO_T795)
	if (numinter > 63)
	{
		numinter -= 64;
		BitSet(IFS2, numinter);
	}
	else if (numinter > 31 && numinter <= 63) 
    #else
	if (numinter > 31)
    #endif
	{
		numinter -= 32;
		BitSet(IEC1, numinter);
	}
	else
	{
		BitSet(IEC0, numinter);
	}
}