Beispiel #1
0
void blit_reset(void)
{
	int i;

	scrbitmap  = (UINT16 *)video_frame_addr(work_frame, 0, 0);
	tex_spr[0] = (UINT8 *)(scrbitmap + BUF_WIDTH * SCR_HEIGHT);
	tex_spr[1] = tex_spr[0] + BUF_WIDTH * TEXTURE_HEIGHT;
	tex_spr[2] = tex_spr[1] + BUF_WIDTH * TEXTURE_HEIGHT;
	tex_fix    = tex_spr[2] + BUF_WIDTH * TEXTURE_HEIGHT;

	for (i = 0; i < FIX_TEXTURE_SIZE; i++) fix_data[i].index = i;
	for (i = 0; i < SPR_TEXTURE_SIZE; i++) spr_data[i].index = i;

	clip_min_y = FIRST_VISIBLE_LINE;
	clip_max_y = LAST_VISIBLE_LINE;

	clut = (UINT16 *)PSP_UNCACHE_PTR(&video_palettebank[palette_bank]);

	blit_clear_all_sprite();
}
Beispiel #2
0
int main(int argc, char** argv) {

	SceCtrlData pad;
	
	getcwd(currentPath, MAX_PATH - 1);
	strcat(currentPath, "/");
	
	strcpy(szAppRomPath, currentPath);
	strcat(szAppRomPath, "ROMS/");
	
	int thid = sceKernelCreateThread(PBPNAME, CallbackThread, 0x11, 0xFA0, 0, 0);
	if(thid >= 0) sceKernelStartThread(thid, 0, 0);
	
	nGameStage = 1;
	init_gui();
	
	
	BurnLibInit();
	
	for (nBurnDrvSelect=0; nBurnDrvSelect<nBurnDrvCount; nBurnDrvSelect++) 
		if ( strcmp("aerofgt", BurnDrvGetText(DRV_NAME)) == 0 )
			break;
	if (nBurnDrvSelect >= nBurnDrvCount) nBurnDrvSelect = ~0U;
	
	bBurnUseASMCPUEmulation = false;
	
	nInterpolation = 3;
	pBurnSoundOut = 0;	//&mixbuf[0];
	nBurnSoundRate = SND_RATE;
	nBurnSoundLen = 0;	//SND_FRAME_SIZE;
	
	//BurnDrvGetFullSize(&VideoBufferWidth, &VideoBufferHeight);
	//printf("%d x %d \n", VideoBufferWidth, VideoBufferHeight);
	nBurnBpp = 2;
	nBurnPitch  = 512 * 2;
	BurnHighCol = HighCol16;
	
	int ret = 0;
	
	//DrvInit(nBurnDrvSelect, false);
	//if (nRet != 0) return 0;

	//BurnRecalcPal();
	//InpInit();
	//InpDIP();
	
	pBurnDraw = (unsigned char *) video_frame_addr(tex_frame, 0, 0);
	
	//szAppRomPath
	//strcat(ui_current_path, "roms");
	
	draw_ui_main();
	bGameRunning = 1;
	
	while( bGameRunning ) {
		sceCtrlReadBufferPositive(&pad, 1); 
		
		if ( nGameStage ) {

			do_ui_key( pad.Buttons );
			
			update_gui();
			sceDisplayWaitVblankStart();
			
		} else {
			
			if ( pad.Buttons & PSP_CTRL_LTRIGGER ) {
				
				scePowerSetClockFrequency(222, 222, 111);
				nGameStage = 1;
				draw_ui_main();
				
				continue;
			}
			
			InpMake(pad.Buttons);
			
			nFramesEmulated++;
			nCurrentFrame++;
			nFramesRendered++;
		
			pBurnDraw = (unsigned char *) video_frame_addr(tex_frame, 0, 0);
			BurnDrvFrame();
			pBurnDraw = NULL;
	
			update_gui();
			
		//sceDisplayWaitVblankStart();

		}

		
		show_frame = draw_frame;
		draw_frame = sceGuSwapBuffers();
	}

	scePowerSetClockFrequency(222, 222, 111);

	exit_gui();
	
	DrvExit();
	BurnLibExit();
	InpExit();
	
	sceKernelExitGame();
}