Esempio n. 1
0
static void do_command(char *c)
{
	char *token;

	token = get_token(&c);

	if(strcmp(token, "flush") == 0) flush_bridge_cache();

	else if(strcmp(token, "mr") == 0) mr(get_token(&c), get_token(&c));
	else if(strcmp(token, "mw") == 0) mw(get_token(&c), get_token(&c), get_token(&c));
	else if(strcmp(token, "mc") == 0) mc(get_token(&c), get_token(&c), get_token(&c));
	else if(strcmp(token, "crc") == 0) crc(get_token(&c), get_token(&c));
	
	else if(strcmp(token, "ls") == 0) ls();
	else if(strcmp(token, "load") == 0) load(get_token(&c), get_token(&c));
	
	else if(strcmp(token, "serialboot") == 0) serialboot();
	else if(strcmp(token, "netboot") == 0) netboot();
	else if(strcmp(token, "cardboot") == 0) cardboot(0);

	else if(strcmp(token, "mdior") == 0) mdior(get_token(&c));
	else if(strcmp(token, "mdiow") == 0) mdiow(get_token(&c), get_token(&c));

	else if(strcmp(token, "reboot") == 0) reboot();
	
	else if(strcmp(token, "help") == 0) help();
	
	else if(strcmp(token, "") != 0)
		printf("Command not found\n");
}
Esempio n. 2
0
static void rpipe_wave_bottom_half()
{
	rpipe_draw_waves();
	flush_bridge_cache();

	tmu_task2.flags = 0;
	tmu_task2.hmeshlast = renderer_hmeshlast;
	tmu_task2.vmeshlast = renderer_vmeshlast;
	tmu_task2.brightness = TMU_BRIGHTNESS_MAX;
	tmu_task2.chromakey = 0;
	tmu_task2.srcmesh = &dst_vertices[0][0];
	tmu_task2.srcfbuf = tex_backbuffer;
	tmu_task2.srchres = vga_hres;
	tmu_task2.srcvres = vga_vres;
	tmu_task2.dstmesh = &dst_vertices[0][0];
	tmu_task2.dstfbuf = vga_backbuffer;
	tmu_task2.dsthres = vga_hres;
	tmu_task2.dstvres = vga_vres;
	tmu_task2.profile = 0;
	if(spam_enabled)
		tmu_task2.callback = NULL;
	else
		tmu_task2.callback = rpipe_tmu_copydone;
	tmu_task2.user = NULL;
	tmu_submit_task(&tmu_task2);

	if(spam_enabled) {
		tmu_task1.flags = TMU_CTL_CHROMAKEY;
		tmu_task1.hmeshlast = SPAM_HMESHLAST;
		tmu_task1.vmeshlast = SPAM_VMESHLAST;
		tmu_task1.brightness = TMU_BRIGHTNESS_MAX;
		tmu_task1.chromakey = SPAM_CHROMAKEY;
		tmu_task1.srcmesh = &spam_src_vertices[0][0];
		tmu_task1.srcfbuf = (unsigned short *)spam_raw;
		tmu_task1.srchres = SPAM_W;
		tmu_task1.srcvres = SPAM_H;
		tmu_task1.dstmesh = &spam_dst_vertices[0][0];
		tmu_task1.dstfbuf = vga_backbuffer;
		tmu_task1.dsthres = vga_hres;
		tmu_task1.dstvres = vga_vres;
		tmu_task1.profile = 0;
		tmu_task1.callback = rpipe_tmu_copydone;
		tmu_task1.user = NULL;
		tmu_submit_task(&tmu_task1);
	}
}
Esempio n. 3
0
static void do_command(char *c)
{
	char *token;

	token = get_token(&c);

	if(strcmp(token, "cons") == 0) vga_set_console(!vga_get_console());
	else if(strcmp(token, "flush") == 0) flush_bridge_cache();
	else if(strcmp(token, "mr") == 0) mr(get_token(&c), get_token(&c));
	else if(strcmp(token, "mw") == 0) mw(get_token(&c), get_token(&c), get_token(&c));
	else if(strcmp(token, "mc") == 0) mc(get_token(&c), get_token(&c), get_token(&c));
	else if(strcmp(token, "crc") == 0) crc(get_token(&c), get_token(&c));

	else if(strcmp(token, "ls") == 0) ls(get_token(&c));
	else if(strcmp(token, "load") == 0) load(get_token(&c), get_token(&c), get_token(&c));

	else if(strcmp(token, "netboot") == 0) netboot();
	else if(strcmp(token, "serialboot") == 0) serialboot();
	else if(strcmp(token, "fsboot") == 0) fsboot(BLOCKDEV_MEMORY_CARD);
	else if(strcmp(token, "flashboot") == 0) flashboot();

	else if(strcmp(token, "mdior") == 0) mdior(get_token(&c));
	else if(strcmp(token, "mdiow") == 0) mdiow(get_token(&c), get_token(&c));

	else if(strcmp(token, "version") == 0) puts(VERSION);
	else if(strcmp(token, "reboot") == 0) reboot();
	else if(strcmp(token, "reconf") == 0) reconf();

	else if(strcmp(token, "help") == 0) help();

	else if(strcmp(token, "rcsr") == 0) rcsr(get_token(&c));
	else if(strcmp(token, "wcsr") == 0) wcsr(get_token(&c), get_token(&c));

	else if(strcmp(token, "") != 0)
		printf("Command not found\n");
}
Esempio n. 4
0
void intro_csv()
{
	int i;
	int sn;
	int r, g, b;
	/* define those as static, or the compiler optimizes the stack a bit too much */
	static struct tmu_td tmu_task;
	static struct tmu_vertex src_vertices[TMU_MESH_MAXSIZE][TMU_MESH_MAXSIZE];
	static struct tmu_vertex dst_vertices[TMU_MESH_MAXSIZE][TMU_MESH_MAXSIZE];

	tmu_task.flags = 0;
	tmu_task.hmeshlast = HMESHLAST;
	tmu_task.vmeshlast = VMESHLAST;
	tmu_task.brightness = 62;
	tmu_task.chromakey = 0;
	tmu_task.srcmesh = &src_vertices[0][0];
	tmu_task.srchres = vga_hres;
	tmu_task.srcvres = vga_vres;
	tmu_task.dstmesh = &dst_vertices[0][0];
	tmu_task.dsthres = vga_hres;
	tmu_task.dstvres = vga_vres;
	tmu_task.profile = 0;
	tmu_task.callback = tmu_complete;
	tmu_task.user = NULL;

	make_mesh(&src_vertices[0][0], &dst_vertices[0][0], 100000);

	sn = 0;
	for(i=0;i<DURATION;i++) {
		tmu_task.srcfbuf = vga_frontbuffer;
		tmu_task.dstfbuf = vga_backbuffer;

		if(i > (DURATION/3))
			make_mesh(&src_vertices[0][0], &dst_vertices[0][0], 100000-(4000*(i-DURATION/3)/DURATION));

		if(i > (DURATION/2)) {
			r = 2*(DURATION-(i-DURATION/2))/DURATION;
			g = 63*(DURATION-(i-DURATION/2))/DURATION;
			b = 0;
		} else {
			r = 2;
			g = 63;
			b = 0;
		}

		tmu_wait = 0;
		tmu_submit_task(&tmu_task);
		while(!tmu_wait);

		if((rand() % 4) == 0) {
			draw_text((rand() % vga_hres) + 1 , (rand() % vga_vres) + 2, MAKERGB565(r, g, b), csv_strings[sn]);
			sn++;
			if(sn == NSTRINGS) sn = 0;
			flush_bridge_cache();
		}
		
		vga_swap_buffers();
	}

	for(i=0;i<POST;i++) {
		tmu_task.srcfbuf = vga_frontbuffer;
		tmu_task.dstfbuf = vga_backbuffer;
		tmu_wait = 0;
		tmu_submit_task(&tmu_task);
		while(!tmu_wait);
		vga_swap_buffers();
	}
}
Esempio n. 5
0
int demo_2() {


    static struct tmu_td tmu_badclouds, tmu_badfactory, tmu_clearscreen;
    static struct tmu_vertex badclouds_src_vtx[TMU_MESH_MAXSIZE][TMU_MESH_MAXSIZE];
    static struct tmu_vertex badclouds_dst_vtx[TMU_MESH_MAXSIZE][TMU_MESH_MAXSIZE];

    static struct tmu_vertex badfactory_src_vtx[TMU_MESH_MAXSIZE][TMU_MESH_MAXSIZE];
    static struct tmu_vertex badfactory_dst_vtx[TMU_MESH_MAXSIZE][TMU_MESH_MAXSIZE];

    static short int black = 0x0000;


    static struct tmu_vertex src_clr_vertices[TMU_MESH_MAXSIZE][TMU_MESH_MAXSIZE];
    static struct tmu_vertex dst_clr_vertices[TMU_MESH_MAXSIZE][TMU_MESH_MAXSIZE];

    int quit = 0 , x = 0;
    //unsigned int x , y ;

    //unsigned short int * vga_position;
    //Initialization
    sprites_init();

    sprites_load(badclouds_raw,badclouds_raw_len,0x001F,138,100,0);
    sprites_load(badclouds_raw,badclouds_raw_len,0x001F,138,100,1);
    sprites_load(badclouds_raw,badclouds_raw_len,0x001F,138,100,2);
    sprites_load(badclouds_raw,badclouds_raw_len,0x001F,138,100,3);
    sprites_load(badclouds_raw,badclouds_raw_len,0x001F,138,100,4);
    sprites_load(badfactory_raw,badfactory_raw_len,0x001F,100,100,0);
/*    debug_sprite(&sprite_data[0]);
    debug_sprite(&sprite_data[1]);
    debug_sprite(&sprite_data[2]);
    debug_sprite(&sprite_data[3]);
    debug_sprite(&sprite_data[4]);
*/

    init_sprite(&badclouds_src_vtx[0][0] , &badclouds_dst_vtx[0][0] , &sprite_data[0]);
    init_sprite(&badfactory_src_vtx[0][0] , &badfactory_dst_vtx[0][0] , &sprite_data[5]);

/*    for ( x = 0; x <= HMESHLAST; x++) {
        for ( y = 0; y <= VMESHLAST; y++) {
            badclouds_src_vtx[x][y].x = x * 138; 
            badclouds_src_vtx[x][y].y = y * 100;
            badclouds_src_vtx[x][y].x = x * 138; 
            badclouds_src_vtx[x][y].y = y * 100;
        }
    }
*/
    src_clr_vertices[0][0].x = 0;
    src_clr_vertices[0][0].y = 0;
    src_clr_vertices[1][0].x = 640;
    src_clr_vertices[1][0].y = 0;
    src_clr_vertices[0][1].x = 0;
    src_clr_vertices[0][1].y = 480;
    src_clr_vertices[1][1].x = 640;
    src_clr_vertices[1][1].y = 480;


    dst_clr_vertices[0][0].x = 0 - 30;
    dst_clr_vertices[0][0].y = 0 - 23;
    dst_clr_vertices[1][0].x = 640 + 30 ;
    dst_clr_vertices[1][0].y = 0 - 23;
    dst_clr_vertices[0][1].x = 0 - 30;
    dst_clr_vertices[0][1].y = 480 + 23;
    dst_clr_vertices[1][1].x = 640 + 30;
    dst_clr_vertices[1][1].y = 480 + 23;

    //tmu_clearscreen.flags = 0;
    tmu_badclouds.flags = TMU_CTL_CHROMAKEY;
    tmu_clearscreen.hmeshlast = 1;
    tmu_clearscreen.vmeshlast = 1;
    tmu_clearscreen.brightness = 60;
    tmu_clearscreen.chromakey = 0;
    tmu_clearscreen.srcmesh = &src_clr_vertices[0][0];
    tmu_clearscreen.srchres = vga_hres;
    tmu_clearscreen.srcvres = vga_vres;
    tmu_clearscreen.dstmesh = &dst_clr_vertices[0][0];
    tmu_clearscreen.dsthres = vga_hres;
    tmu_clearscreen.dstvres = vga_vres;
    tmu_clearscreen.profile = 0;
    tmu_clearscreen.callback = tmu_complete;
    tmu_clearscreen.user = NULL;

    tmu_badclouds.flags = TMU_CTL_CHROMAKEY;
    tmu_badclouds.hmeshlast = HMESHLAST;
    tmu_badclouds.vmeshlast = VMESHLAST;
    tmu_badclouds.brightness = 62;
    tmu_badclouds.chromakey = CHROMAKEY;
    tmu_badclouds.srcmesh = &badclouds_src_vtx[0][0];
    tmu_badclouds.srchres = 138;
    tmu_badclouds.srcvres = 100;
    tmu_badclouds.dstmesh = &badclouds_dst_vtx[0][0];
    tmu_badclouds.dsthres = vga_hres;
    tmu_badclouds.dstvres = vga_vres;
    tmu_badclouds.profile = 0;
    tmu_badclouds.callback = tmu_complete;
    tmu_badclouds.user = NULL;



    tmu_badfactory.flags = TMU_CTL_CHROMAKEY;
    tmu_badfactory.hmeshlast = HMESHLAST;
    tmu_badfactory.vmeshlast = VMESHLAST;
    tmu_badfactory.brightness = 62;
    tmu_badfactory.chromakey = CHROMAKEY;
    tmu_badfactory.srcmesh = &badclouds_src_vtx[0][0];
    tmu_badfactory.srchres = 100;
    tmu_badfactory.srcvres = 100;
    tmu_badfactory.dstmesh = &badclouds_dst_vtx[0][0];
    tmu_badfactory.dsthres = vga_hres;
    tmu_badfactory.dstvres = vga_vres;
    tmu_badfactory.profile = 0;
    tmu_badfactory.callback = tmu_complete;
    tmu_badfactory.user = NULL;


    x = 0;
    frames = 0;

    while(quit < 10)
    {
        tmu_clearscreen.srcfbuf = vga_lastbuffer;
        tmu_clearscreen.dstfbuf = vga_backbuffer;

        tmu_wait = 0;
        tmu_submit_task(&tmu_clearscreen);
        while(!tmu_wait);
        
        //update_sprite(tmu_badclouds.dstmesh ,&sprite_data[x/20], 320 , 240 , frames);
        if (x/40 == 5) { 
        init_sprite(tmu_badfactory.srcmesh,tmu_badclouds.dstmesh ,&sprite_data[x/40]);
        scale_sprite(tmu_badfactory.dstmesh , (100 + COS[frames])/10 , (100 + COS[frames])/10 ); 
        rotate_sprite(tmu_badfactory.dstmesh , frames); 
        move_sprite(tmu_badfactory.dstmesh , 320 , 240);
        tmu_badfactory.srcfbuf = sprite_data[x/40].data;
        tmu_badfactory.dstfbuf = vga_backbuffer;
        } else {
        init_sprite(tmu_badclouds.srcmesh,tmu_badclouds.dstmesh ,&sprite_data[x/40]);
        scale_sprite(tmu_badclouds.dstmesh , (100 + COS[frames])/10 , (100 + COS[frames])/10 ); 
        rotate_sprite(tmu_badclouds.dstmesh , frames); 
        move_sprite(tmu_badclouds.dstmesh , 320 , 240);
        tmu_badclouds.srcfbuf = sprite_data[x/40].data;
        tmu_badclouds.dstfbuf = vga_backbuffer;
        }
/* 
        tmu_clearscreen.srcfbuf = &black;
        tmu_clearscreen.dstfbuf = vga_backbuffer;

        tmu_wait = 0;
        tmu_submit_task(&tmu_clearscreen);
        while(!tmu_wait);
*/

        tmu_wait = 0;
        tmu_submit_task(&tmu_badclouds);
        while(!tmu_wait);
        flush_bridge_cache();

        vga_swap_buffers();
//        demo_sleep(10);
        x += 1;
        frames+=5;
        if (frames > 360) frames = frames - 360;
        if (x == 240) {x = 0;quit++;}
    }

    return 0;
}