Exemplo n.º 1
0
// With or without sound, run one frame.
// If bDraw is true, it's the last frame before we are up to date, and so we should draw the screen
static int RunFrame(int bDraw,int bPause)
{
	static int bOldStretch=0;

	nCurrentFrame++;

	if (bDraw)
	{
		if (bOldStretch && bDtoStretch==0)
			// image may have shrunk
		{
			InvalidateRect(hScrnWnd,NULL,1);    // blank scrn window
			UpdateWindow(hScrnWnd);
		}
	}
	bOldStretch=bDtoStretch;

	GetInput(); // Get input on all frames

	InputTick(); // Tick one frame of input (for sliders etc)

	if (!bPause)
	{
		if (bDraw)
		{
			VidFrame();  // Do one frame
			VidPaint(0); // paint the screen (no need to validate)
		}
		else
		{
			// frame skipping
			pBurnDraw=NULL; // Make sure no image is drawn
			if (bDrvOkay)
			{
				BurnDrvFrame();
			}
		}
	}
	return 0;
}
Exemplo n.º 2
0
// With or without sound, run one frame.
// If bDraw is true, it's the last frame before we are up to date, and so we should draw the screen
static int RunFrame(int bDraw, int bPause)
{
	static int bPrevPause = 0;
	static int bPrevDraw = 0;

	extern bool bDoPostInitialize;

	// Exit Jukebox properly
	
	if(bDoPostInitialize == true && bJukeboxInUse == true) {
		DrvExit();
		bJukeboxDisplayed	= false;
		bJukeboxInUse		= false;
		bDoPostInitialize = false;
		POST_INITIALISE_MESSAGE;
	}

	if (bPrevDraw && !bPause) {
		VidPaint(0);							// paint the screen (no need to validate)
	}

	if (!bDrvOkay) {
		return 1;
	}

	if (bPause && bJukeboxInUse == true) {
		GetInput(false);						// Update burner inputs, but not game inputs
		if (bPause != bPrevPause) {
			VidPaint(2);                        // Redraw the screen (to ensure mode indicators are updated)
		}
		return 0;
	}
	
	if (!bPause && bJukeboxInUse == true) {
		//if (!bJukeboxDisplayed) JukeboxDialogCreate();
		int TracklistDialog();

		if (bJukeboxDisplayed == false) TracklistDialog();
		nFramesEmulated++;
		nCurrentFrame++;
		BurnJukeboxFrame();
		return 0;		
	}

	if (bPause) {
		GetInput(false);						// Update burner inputs, but not game inputs
		if (bPause != bPrevPause) {
			VidPaint(2);                        // Redraw the screen (to ensure mode indicators are updated)
		}
	} else {

		nFramesEmulated++;
		nCurrentFrame++;

		if (kNetGame) {
			GetInput(true);						// Update inputs
			if (KailleraGetInput()) {			// Synchronize input with Kaillera
				return 0;
			}
		} else {
			if (nReplayStatus == 2) {
				GetInput(false);				// Update burner inputs, but not game inputs
				if (ReplayInput()) {			// Read input from file
					bAltPause = 1;
					bRunPause = 1;
					MenuEnableItems();
					InputSetCooperativeLevel(false, false);
				}
			} else {
				GetInput(true);					// Update inputs
			}
		}

		if (nReplayStatus == 1) {
			RecordInput();						// Write input to file
		}

		if (bDraw) {
			nFramesRendered++;

			if (VidFrame()) {					// Do one frame
				AudBlankSound();
			}
		} else {								// frame skipping
			pBurnDraw = NULL;					// Make sure no image is drawn
			BurnDrvFrame();
		}

		if (bShowFPS) {
			if (nDoFPS < nFramesRendered) {
				DisplayFPS();
				nDoFPS = nFramesRendered + 30;
			}
		}
	}

	bPrevPause = bPause;
	bPrevDraw = bDraw;

	return 0;
}
Exemplo n.º 3
0
// With or without sound, run one frame.
// If bDraw is true, it's the last frame before we are up to date, and so we should draw the screen
static int RunFrame(int bDraw, int bPause)
{
	static int bPrevPause = 0;
	static int bPrevDraw = 0;

	if (bPrevDraw && !bPause) {
		VidPaint(0);							// paint the screen (no need to validate)
	}

	if (!bDrvOkay) {
		return 1;
	}

	if (bPause) {
		GetInput(false);						// Update burner inputs, but not game inputs
		if (bPause != bPrevPause) {
			VidPaint(2);                        // Redraw the screen (to ensure mode indicators are updated)
		}
	} else {

		nFramesEmulated++;
		nCurrentFrame++;

		if (kNetGame) {
			GetInput(true);						// Update inputs
			if (KailleraGetInput()) {			// Synchronize input with Kaillera
				return 0;
			}
		} else {
			if (nReplayStatus == 2) {
				GetInput(false);				// Update burner inputs, but not game inputs
				if (ReplayInput()) {			// Read input from file
					bAltPause = 1;
					bRunPause = 1;
					MenuEnableItems();
					InputSetCooperativeLevel(false, false);
				}
			} else {
				GetInput(true);					// Update inputs
			}
		}

		if (nReplayStatus == 1) {
			RecordInput();						// Write input to file
		}

		if (bDraw) {
			nFramesRendered++;

			if (VidFrame()) {					// Do one frame
				AudBlankSound();
			}
		} else {								// frame skipping
			pBurnDraw = NULL;					// Make sure no image is drawn
			BurnDrvFrame();
		}

		if (bShowFPS) {
			if (nDoFPS < nFramesRendered) {
				DisplayFPS();
				nDoFPS = nFramesRendered + 30;
			}
		}
	}

	bPrevPause = bPause;
	bPrevDraw = bDraw;

	return 0;
}
Exemplo n.º 4
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();
}