예제 #1
0
ex_format()
{
#if DISKFLAG
	register int trackno,i,driveno,nsides;
	int error,saveMP;
	char progress[80],trackstr[3];

	if (do_dial(fmtaddr,-1,0L) == CANFMT) return;
	if (midiplexer) saveMP=MPoff();

/* drive A (0) or B (1) ? */
	driveno= whichbutton(fmtaddr,DRIVEA,2);
/* single (0) or double (1) sided ? */
	nsides= whichbutton(fmtaddr,SIDE1,2);

	graf_mouse(BEE_MOUSE);
	
/* format 80 tracks, 9 sectors per track, 1 or 2 sides, drive A or B,
	abort on any error */
	trackno= 0;
	copy_words(scrbase,cnxscrsave,800L);	/* save progress display area */
	set_words(scrbase,800L,0);
	do
	{
		strcpy(progress,FMT_MSG);
		itoa(trackno,trackstr,2);
		strcat(progress,trackstr);
		strcat(progress,FMT2_MSG);
		gr_text(progress,40-strlen(progress)/2,1);			/* centered */
		for (i=error=0; !error&&(i<=nsides); i++)
			if (Flopfmt(scrsave,0L,driveno,9,trackno,i,1,0x87654321L,0xe5e5))
				error=1;
		if (getmouse(&dummy,&dummy)) error=2; /* abort on mouse button */
	}
	while ( ((++trackno)<80) && !error);
	copy_words(cnxscrsave,scrbase,800L);	/* restore progress display area */

	if (!error)
	{
		set_words(scrsave,4608L,0);
		if (Flopwr(scrsave,0L,driveno,1,0,0,9)) error=1;    /* zero the FAT */
		if (!error)
		{
			if (Flopwr(scrsave,0L,driveno,1,1,0,9)) error=1;
			if (!error)
			{
				Protobt(scrsave,0x01000000,2+nsides,0);   /* write a boot sector */
				if (Flopwr(scrsave,0L,driveno,1,0,0,1)) error=1;
			}
		}
	}

	waitmouse();	/* in case formatting was aborted via mouse */
	graf_mouse(ARROWMOUSE);
	if (!error) make_tone();					/* no error */
	if (error==1) form_alert(1,BADFMT);		/* error */
	if (error==2) form_alert(1,BADFMT2);	/* aborted */
	if (midiplexer&&saveMP) MPon();

#endif
}	/* end ex_format() */
Dictionary::Dictionary(list<string> words){

	set_words(words);
}
예제 #3
0
void rSet::clear(char *start, char *end) {
  int* from  = (int*) start;
  int  count = (int*) end - from;
  set_words(from, count, AllBits);
}