Ejemplo n.º 1
0
	void move_cursor(int *pos, int newpos) {
		bfont_draw_str(vram_s + *pos, 640, 1, " ");
		bfont_draw_str(vram_s + *pos + FILES_W, 640, 1, " ");
		*pos=newpos;
		bfont_draw_str(vram_s + *pos, 640, 1, ">");
		bfont_draw_str(vram_s + *pos + FILES_W, 640, 1, "<");
	}
Ejemplo n.º 2
0
	void list_directory() {
		int		i, o=FILES_Y * 640 + FILES_X;

		bfont_set_encoding(BFONT_CODE_ISO8859_1);
		for (i=top; i < top + MAX_FILES_LIST; i++) {
			if (i <= list->getTotal()) {
				bfont_draw_str(vram_s + o, 640, 1, list->getItem(i)->name);
			} else {
				bfont_draw_str(vram_s + o, 640, 1, "            ");
			}
			o += 640*24;
		}
	}
Ejemplo n.º 3
0
int dc_main(void)
{
    unsigned long bin_size = 0xfeedbeef;
    char tmp_str[8];

    vid_init(vid_check_cable(), DM_640x480, PM_RGB565);
    vid_clear(0,100,0);

    /* Relocate the 1st_read.bin */
    bin_size = *((unsigned long *) REAL_LOAD_POINT);
    uint_to_string(bin_size, tmp_str);
    bfont_draw_str(vram_s+10*640+20, 640, "bin_size = ");
    bfont_draw_str(vram_s+50*640+20, 640, tmp_str);
    memmove((unsigned char *) REAL_LOAD_POINT, (unsigned char *) LOADED_POINT, bin_size);

    dbr_set(ubc_works);
    vbr_set(vbr_buffer);

    *UBC_R_BARA = (unsigned int) BREAKPOINT;
    *UBC_R_BAMRA = (1<<2);
    *UBC_R_BBRA = (1<<5) | (1<<4) | (1<<3) | (1<<2);
    *UBC_R_BRCR = (1<<10) | (1<<15) | 1;

    ubc_wait();
    ubc_wait();
    ubc_wait();
    ubc_wait();   

    vid_clear(50,0,50);

    disable_cache();
    (*(void (*)()) REAL_LOAD_POINT) ();

    vid_init(vid_check_cable(), DM_640x480, PM_RGB565);
    vid_clear(100,0,0);
    bfont_draw_str(vram_s+100*640+20, 640, "[UBC] DANGER! We're returned from the game!");
    while(1);
}
Ejemplo n.º 4
0
void DC_DrawString(int x, int y, char *str) {
    bfont_draw_str(bbuffer + ((y + 1) * 24 * 640) + (x * 12), 640, 0, str);
}
Ejemplo n.º 5
0
int main(int argc,char **argv){
	Init();
	//sndoggvorbis_start("/pc/billy.ogg",-1);
	Lights[0].z = 10.0;
	Lights[0].x = 0.0;
	Lights[0].y = 0.0;
	Lights[0].w = 1.0;
	Lights[0].r = 5.0;
	Lights[0].g = 0.0;
	Lights[0].b = 0.0;
	Lights[0].a = 1.0;
	Lights[0].aa = 0.0;
	Lights[0].ab = 0.0;
	Lights[0].ac = 1.0;
	Lights[0].dummy = 1.0;
	
	Lights[1].z = 10.0;
	Lights[1].x = 100.0;
	Lights[1].y = 100.0;
	Lights[1].w = 1.0;
	Lights[1].r = 0.0;
	Lights[1].g = 5.0;
	Lights[1].b = 0.0;
	Lights[1].a = 1.0;
	Lights[1].aa = 0.0;
	Lights[1].ab = 0.0;
	Lights[1].ac = 1.0;
	Lights[1].dummy = 1.0;
	
	Lights[2].z = 10.0;
	Lights[2].x = 400.0;
	Lights[2].y = 400.0;
	Lights[2].w = 1.0;
	Lights[2].r = 0.0;
	Lights[2].g = 0.0;
	Lights[2].b = 5.0;
	Lights[2].a = 1.0;
	Lights[2].aa = 0.0;
	Lights[2].ab = 0.0;
	Lights[2].ac = 1.0;
	Lights[2].dummy = 1.0;

	
	vid_border_color(255,0,0);
	Load_Texture("/rd/bumpmap.raw",&GlobalNormal);
	Load_Texture("/rd/text.raw",&GlobalTex);
	vid_border_color(0,0,255);
	Init_Layer();
	
	
	
	int q = 0;
	int x = 0;
	int pushed = 0;
	int bumpenabled = 1;
	int display_fps = 0;
	bfont_set_encoding(BFONT_CODE_ISO8859_1);
	while(q == 0){
		mat_identity();

		
		vid_border_color(255,0,0);
		pvr_wait_ready();
		vid_border_color(0,255,0);
		pvr_scene_begin();
		pvr_list_begin(PVR_LIST_OP_POLY);
			Draw_Layer();
		pvr_list_finish();
		
		pvr_list_begin(PVR_LIST_TR_POLY);
		if(bumpenabled)
			Draw_Layer_Bump();
		pvr_list_finish();
		
		pvr_scene_finish();
		vid_border_color(0,0,255);
	
		MAPLE_FOREACH_BEGIN(MAPLE_FUNC_CONTROLLER, cont_state_t, st);
			if(st->buttons & CONT_START)
				q = 1;
			
			if(st->joyx > 32){
				Lights[x].x += 4.0f;
			}
			if(st->joyx < -32){
				Lights[x].x -= 4.0f;
			}
			if(st->joyy < -32){
				Lights[x].y -= 4.0f;
			}
			if(st->joyy > 32){
				Lights[x].y += 4.0f;
			}
			
			
			if(st->buttons & CONT_DPAD_LEFT){
				Lights[x].x -= 4.0f;
			}
			if(st->buttons & CONT_DPAD_RIGHT){
				Lights[x].x += 4.0f;
			}
			if(st->buttons & CONT_DPAD_UP){
				Lights[x].y -= 4;
			}
			if(st->buttons & CONT_DPAD_DOWN){
				Lights[x].y += 4;
			}
				
			if(st->buttons & CONT_A && pushed == 0){
				pushed = 1;
				x++;
				if(x == LIGHTS){
					x = 0;
				}
			} 
			
			if(st->buttons & CONT_Y && pushed == 0){
				LIGHTS--;
				pushed = 1;
				if(LIGHTS < 0){
					LIGHTS = MAX_LIGHTS;
				}
			}
			
			if(st->buttons & CONT_B && pushed == 0){
				display_fps ^= 0x01;
				pushed = 1;
			}
			
			if(st->buttons & CONT_X && pushed == 0){
				bumpenabled ^= 0x01;
				pushed = 1;
			}
			
			if(!(st->buttons & CONT_A) && !(st->buttons & CONT_B) && !(st->buttons & CONT_X) && !(st->buttons & CONT_Y)){
				pushed = 0;
			}
			
		
		MAPLE_FOREACH_END();
		running_stats();
		sprintf(buf,"FPS:%f",avgfps);
		if(display_fps){
				//printf("%s\n",buf);
			bfont_draw_str(vram_s + (640*24),640,1,buf);
		}
		
	}
	DeleteTexture(&GlobalNormal);
	DeleteTexture(&GlobalTex);
	//sndoggvorbis_stop();
	//sndoggvorbis_shutdown();
	pvr_shutdown();
	return 0;
}