예제 #1
0
neosplash(){
    disp_off();
    cls();
    load_palette(16,neosprpal,1);
    load_vram(0x5000,neospr,0x400);
    load_palette(0,badge1pal,1);
    set_tile_data(neotiles);
    load_tile(0x1000);
    for(j=0;j<14;j++){
        for(i=0;i<14;i++){
            put_tile(j*14+i,i+1,j);
        }
    }

    for(i=0;i<8;i++){
        spr_set(i);
        spr_pal(0);
        spr_pri(1);
        spr_ctrl(SIZE_MAS,SZ_32x16);
        spr_pattern(0x5000+0x80*i);
        spr_y(224-24);
        spr_x(i*32);
    }
    disp_on();
    t=0;
    for(;;){
        t++;

        vsync();
        joy0=joy(0);
        satb_update();
        if(joy0&JOY_STRT){
            break;
        }
        if(t>144)break;
    }
    psgPlay(0);
    disp_off();
    for(i=0;i<8;i++){
        spr_set(i);
        spr_hide();
    }
    satb_update();
    cls();
    set_color(0,0);
    set_color(256,0);
    disp_on();

    while(joy0&JOY_STRT){
        vsync();
        joy0=joy(0);
    }


}
예제 #2
0
파일: disp.c 프로젝트: psi4/libefp
static double
point_point_disp(struct efp *efp, size_t fr_i_idx, size_t fr_j_idx,
		 size_t pt_i_idx, size_t pt_j_idx, double s, six_t ds,
		 const struct swf *swf)
{
	struct frag *fr_i = efp->frags + fr_i_idx;
	struct frag *fr_j = efp->frags + fr_j_idx;

	const struct dynamic_polarizable_pt *pt_i =
				fr_i->dynamic_polarizable_pts + pt_i_idx;
	const struct dynamic_polarizable_pt *pt_j =
				fr_j->dynamic_polarizable_pts + pt_j_idx;

	double sum = 0.0;

	for (size_t k = 0; k < ARRAY_SIZE(weights); k++) {
		double tr_i = (pt_i->tensor[k].xx + pt_i->tensor[k].yy + pt_i->tensor[k].zz) / 3;
		double tr_j = (pt_j->tensor[k].xx + pt_j->tensor[k].yy + pt_j->tensor[k].zz) / 3;

		sum += weights[k] * tr_i * tr_j;
	}

	switch (efp->opts.disp_damp) {
		case EFP_DISP_DAMP_TT:
			return disp_tt(efp, fr_i_idx, fr_j_idx,
				pt_i_idx, pt_j_idx, sum, swf);
		case EFP_DISP_DAMP_OVERLAP:
			return disp_overlap(efp, fr_i_idx, fr_j_idx,
				pt_i_idx, pt_j_idx, s, ds, sum, swf);
		case EFP_DISP_DAMP_OFF:
			return disp_off(efp, fr_i_idx, fr_j_idx,
				pt_i_idx, pt_j_idx, sum, swf);
	}
	assert(0);
}
예제 #3
0
파일: main.c 프로젝트: laszuba/binary_watch
// IMPORTANT: if interrupts are not enabled, the processor will never wake
// from sleep
void sleep_proc() {
	enable_pcint();
	// Turn off timer0
	disable_pwm();
	disp_off();

	// probably want power save mode
	// everything off but Timer2 interrupts
	set_sleep_mode(SLEEP_MODE_PWR_SAVE);

	sleep_mode(); 
	// Continue here on wake

	disable_pcint();
	return;
}
예제 #4
0
squirrelsplash(){
    disp_off();
    cls();
    foo=6;

    put_string("           PC  Engine           ",0,foo);
    put_string("        MML Sound Library       ",0,2+foo);
    put_string("           'SQUIRREL'           ",0,4+foo);
    put_string("         By: Aetherbyte         ",0,6+foo);
    put_string("   http://www.aetherbyte.com/   ",0,8+foo);

    foo++;

    put_string("  Game concept and graphics by  ",0,12+foo);
    put_string("   http://lazybraingames.com/   ",0,14+foo);

    disp_on();

    bar=0;
    while(1){
        lastjoy0=joy0;
        vsync();
        bar++;
        joy0=joy(0);
        if(joy0&JOY_STRT)break;
        if(bar>90)break;
    }
    cls();
    while(joy0&JOY_STRT){
        vsync();
        joy0=joy(0);
    }



}
예제 #5
0
파일: ac_test.c 프로젝트: ArtemioUrbina/huc
main()
{
	
	char i,j,k,l,m,n;
	
	
		
	disp_off();		/* <- I don't think this works.... */
	spr_set();
	spr_hide();
	load_default_font();
	set_screen_size(SCR_SIZE_32x32);
	disp_on();

	if(!sgx_detect())
	{  put_string("Halt: SGX not hardware found", 2, 13); for(;;){} }


	/* These NEED to be set, else you won't see the SGX 2nd layer BG or sprites. */
	vpc_win_size( VPC_WIN_A, 0x01ff);
	vpc_win_size( VPC_WIN_B, 0x01ff);
	vpc_win_reg( VPC_WIN_A, VDC_ON+VPC_NORM);
	vpc_win_reg( VPC_WIN_B, VDC_ON+VPC_NORM);
	vpc_win_reg( VPC_WIN_AB, VDC_ON+VPC_NORM);
	vpc_win_reg( VPC_WIN_NONE, VDC_ON+VPC_NORM);
	
	set_font_pal(4);
	set_font_color(14,0);
	load_default_font();
	put_string("SGX hardware found", 2, 3);
	
	sgx_set_screen_size(SCR_SIZE_32x32);
	sgx_load_vram(0x0000,map, 0x400);
	sgx_load_vram(0x1000,tile, 0x4000);
	load_palette(0, pal,16);
	
	sgx_spr_hide();
	sgx_spr_set(1);

	sgx_disp_on();
	
	
	put_string("Arcade Card: ", 2, 4);


	if ( ac_init() )
		{
			put_string("detected.", 15, 4);

			/* initialize AC register 0 to address 0x000000 and +1 auto-increment */
			ac_full_reg0(0x00,0x0000,0x0000,0x0001,0x11);
							
			put_string("CD->AC xfer... ", 2, 5);

			/* transfer 8k at a time from CD to AC memory via AC reg #0 */
			ac_cd_xfer(AC_REG0,0,0x1c2,4);
			ac_cd_xfer(AC_REG0,0,0x1c6,4);
			ac_cd_xfer(AC_REG0,0,0x1ca,4);
			ac_cd_xfer(AC_REG0,0,0x1ce,4);
			ac_cd_xfer(AC_REG0,0,0x1d2,4);
			ac_cd_xfer(AC_REG0,0,0x1d6,4);
			ac_cd_xfer(AC_REG0,0,0x1da,4);
			ac_cd_xfer(AC_REG0,0,0x1de,4);

			put_string("finished.", 17, 5);
						
			sgx_bg_on();
			
			/* reset AC reg #0 address to 0x000000 */		
			ac_addr_reg0(0x00,0x0000);
			ac_vram_dma(AC_REG0 ,0x1000,0x3c00, SGX);

			ac_addr_reg0(0x00,0x8000);
			ac_vram_dma(AC_REG0 ,0x0000,0x800, SGX);

			ac_addr_reg0(0x00,0x8800);
			ac_vce_copy( AC_REG0, 0x00, 0x100 );
			

			vsync(60);
			vsync(60);


		}
	else
		{ put_string("not detected.", 15, 4); for(;;){} }
			
	put_string("Scrolling SGX layer ", 2, 6);
	for(;;)
	{
		for( j=0; j<0xff; j++)
		{
			vsync();
			sgx_scroll( j , j);
		}
	}		
	
	
}
예제 #6
0
void main()
{
    int sel = 0;

	redraw = 1;
	refresh = 1;
	

#ifndef CDROM
	xres_flags = XRES_SOFT;
	Enabled240p = 1;
	UseDefault = 0;
	EnabledSoft = 1;
	Enabled_C_BW = 0;
#endif

#ifdef CDROM
	RestoreGlobals();
#endif

#ifdef CDROM1	
	if(prev_select)
	{
		sel = prev_select;
		prev_select = 0;
	}
#endif

	disp_off();
	set_xres(320, xres_flags);
	if(Enabled240p)
		Set240p();

#ifndef CDROM
	disp_on();
	DrawIntro();
	disp_off();
#endif

    while(1)
    {   	
		vsync();
	
#ifdef CDROM1
		if(!HelpItem)
		{
#endif

        if(redraw)
        {
			RedrawMain();
            redraw = 0;
			refresh = 1;
			disp_on();
        }
		
		set_font_pal(15);
		
		if(refresh)
        {
            RefreshMain(sel);

            refresh = 0;
        }

        controller = joytrg(0);
		
		if (controller & JOY_SEL)
		{
#ifdef CDROM1
			x_g = 0;
#endif
			Options();
			redraw = 1;
		}
        
        if (controller & JOY_DOWN) 
        {
            sel++;
            if(sel > 14)
                sel = 0;
            refresh = 1;
        }

        if (controller & JOY_UP) 
        {
            sel--;
            if(sel < 0)
                sel = 14;
            refresh = 1;
        }
		
		if (controller & JOY_RUN)
		{
			showHelp(GENERAL_HELP);
			redraw = 1;
		}
#ifdef CDROM1
		}
		else
		{
			if(HelpItem <= OPTIONS_HELP)
			{
				sel = HelpItem;
				controller = JOY_I;
			}
				
			HelpItem = 0;
		}
#endif
		
		if (controller & JOY_I)
		{
			disp_off();
			ResetVideo();
			switch(sel)
			{
				case 0:
#ifndef CDROM1
					TestPatterns();
#else
					xres_flags_g = xres_flags;
					Enabled240p_g = Enabled240p;
					UseDefault_g = UseDefault;
					EnabledSoft_g = EnabledSoft;
					Enabled_C_BW_g = Enabled_C_BW;
					
					set_font_pal(14);
					put_string("Loading...", 27, 26);
					cd_execoverlay(PATTERNS_OVERLAY);
#endif
					break;
				case 1:
					DropShadow();
					break;
				case 2:
					StripedSprite();
					break;
				case 3:
					LagTest();
					break;
				case 4:
					ManualLagTest();
					break;
				case 5:
					ScrollTest();
					break;
				case 6:
					VScrollTest();
					break;
				case 7:
					DrawStripes();
					break;
				case 8:
					DrawCheck();
					break;
				case 9:
					LEDZoneTest();
					break;
				case 10:
					SoundTest();
					break;
				case 11:
					AudioSyncTest();
					break;
				case 12:
#ifdef CDROM1
					prev_select = sel;
#endif
					Options();
					break;
				case 13:
#ifdef CDROM1
					prev_select = sel;
#endif
					showHelp(GENERAL_HELP);
					break;
				case 14:
					DrawCredits();
					break;
			}
			redraw = 1;			
			disp_off();
		}
    }
}
예제 #7
0
파일: arpg.c 프로젝트: Lochlan/pce-arpg
clear_display() {
    disp_off();
    cls();
    disp_on();
}