示例#1
0
void promptSDcard(struct Env* p, alt_up_sd_card_dev* device_reference) {
	/*
	 * Loading Screen if SD card is not presented
	 */

	int frame = 25;
	struct animation* b = initAnimation((int*)pacman01, 1);
	addImage(b, initAnimation((int*)pacman02, 0));
	addImage(b, initAnimation((int*)pacman03, 0));
	addImage(b, initAnimation((int*)pacman04, 0));
	struct Object *face;
	face= initObject(80, 120, 10, b, NULL);
	addToEnv(p, face);

	alt_alarm_start (&alarm,alt_ticks_per_second(),my_alarm_callback,(void*)p);


	while(!loadSDCard(device_reference)) {
		displayString("Please insert the SD card to start", frame, 30);
		frame++;
		setXY(face, face->x+4, face->y);
		if(face->x >245) face->x = 0;
		if(frame > 61) frame = 0;

		usleep(300000);
	}alt_up_char_buffer_clear(char_buffer);
	killAnimation(b);
	removeFromEnv(p, face);
	alt_alarm_stop(&alarm);
	alt_up_pixel_buffer_dma_clear_screen(pixel_buffer, 0);
}
示例#2
0
int main()
{
	//SD device initialization
	up_dev.device_reference = NULL;
	while(!loadSDCard(up_dev.device_reference)) {
		printf("SD card is not connected.\n");
	}

	initVGA();
	initAudioDeviceController();
	initSoundMixer();

	struct CmdScheduler* scheduler = initCmdScheduler();

	//Serial device initialization
	com = initRS232(scheduler);

	initPushKeyController();

	initDatabase();
	initMemory();

	//sync database
	update();

	//Test VGA Output
	/*struct Image* testImg;
	while((testImg = loadSDImage("TEST.BMP")) == NULL);
	draw(35, 35, testImg);
	killImage(testImg);*/
	//alt_up_char_buffer_string(char_buffer, "Initialization Completed", 27, 5);


	alt_up_pixel_buffer_dma_clear_screen(pixel_buffer, 0);
	alt_up_char_buffer_clear(char_buffer);

	//graphicTester();

	struct Frame* mainFrame = initMainFrame();
	mainFrame->drawFrame(mainFrame);


	//Test End
	mouse = initCursor(10, 100, mainFrame);
	//graphicTester();

	//drawAllSongsInList(2);
	//drawAllSongsInList(2);
	/*int i;
	struct Frame* b;
	for (i = 0; i < 5000; i++){
		drawAllSongsInList(2);
		//b = initSongInListPanel(mainFrame, 2);
		//killSongInListPanel(&b);
		printf("Iteration %d\n", i);
	}*/

	initAudioBuffer();
	initAnimate(mouse);

	int i = 2;

	syncPlay(1, 100, 0);

	while(1) {
		cmdProcessing(scheduler);

		i = soundTester(i);

	}


	return 0;
}