Example #1
0
void TDMSessionsWidget::save()
{
    config->setGroup("X-:*-Core");
    writeSD(sdlcombo);
    config->writeEntry( "TerminateServer", tsbox->isChecked() );

    config->setGroup("X-*-Core");
    writeSD(sdrcombo);

    config->setGroup("Shutdown");
    config->writeEntry("HaltCmd", shutdown_lined->url(), true);
    config->writeEntry("RebootCmd", restart_lined->url(), true);

    config->writeEntry("BootManager", bm_combo->currentId());
}
Example #2
0
// create a NIC image file
int createNic(unsigned char *name)
{
	unsigned short re, clusterNum;
	unsigned long ft, adr;
	unsigned short d, i;
	unsigned char c, dirEntry[32], at;
	static unsigned char last[2] = {0xff, 0xff};
	
	for (i=0; i<32; i++) dirEntry[i]=0;
	memcp(dirEntry, name, 8);
	memcp(dirEntry+8, (unsigned char *)"NIC", 3);
	*(unsigned long *)(dirEntry+28) = (unsigned long)286720;
	
	// search a root directory entry
	for (re=0; re<512; re++) {
		cmd(16, 1);
		cmd17(rootAddr+re*32+0);
		c = readByte();
		readByte(); readByte(); // discard CRC bytes
		cmd17(rootAddr+re*32+11);
		at = readByte();
		readByte(); readByte(); // discard CRC bytes
		if (((c==0xe5)||(c==0x00))&&(at!=0xf)) break;  // find a RDE!
	}	
	if (re==512) return 0;
	// write a directory entry
	writeSD(rootAddr+re*32, dirEntry, 32);	
	// search the first fat entry
	adr = (rootAddr+re*32+26);
	clusterNum = 0;
	for (ft=2;
		(clusterNum<((560+sectorsPerCluster-1)>>sectorsPerCluster2)); ft++) {
		cmd(16, 2);
		cmd17(fatAddr+ft*2);
		d = readByte();
		d += (unsigned short)readByte()*0x100;
		readByte(); readByte(); // discard CRC bytes
		if (d==0) {
			clusterNum++;
			writeSD(adr, (unsigned char *)&ft, 2);
			adr = fatAddr+ft*2;
		}
	}
	writeSD(adr, last, 2);
	duplicateFat();
	return 1;
}
Example #3
0
//Displayed when the game is over
void GameOverScreen() {
	clearScreen();
	updateScreen();
	clearCharBuffer();

	initSD();
	int i;
	for (i = 0; i < numPlayers; ++i) {
		if (p[i].name != NULL && p[i].type == HUMAN) {
			char name[10];
			strcpy(name, p[i].name);
			writeSD(name, p[i].points);
			printf("write:%i score: %i\n", i,p[i].points);
		}
	}

	for (i = 0; i < numPlayers; ++i) {
		printf("%s", p[i].name);
	}

	printString("GAME OVER!", 30, 25);
	usleep(1000000);

	clearScreen();
	updateScreen();
	clearCharBuffer();
	//displayHighScore("abc","a","b","c");
	if (numPlayers == 2) {
		displayHighScore(p[pOne].name, p[pTwo].name, NULL, NULL);
		printf("TWO");
	} else if (numPlayers == 3) {
		displayHighScore(p[pOne].name, p[pTwo].name, p[pThree].name, NULL);
		printf("THREE");
	} else {
		displayHighScore(p[pOne].name, p[pTwo].name, p[pThree].name,
				p[pFour].name);
		printf("ALL");
	}
	updateScreen();
	usleep(10000000);
	state = 0;
}