Exemplo n.º 1
0
static int RunInit()
{
	// Try to run with sound
	RunReset();

	return 0;
}
Exemplo n.º 2
0
static int RunInit()
{
	// Try to run with sound
	DSoundGetNextSound=RunGetNextSound;
	AudSoundPlay();
	RunReset();
	GetInput();
	return 0;
}
Exemplo n.º 3
0
static int RunInit()
{
	// Try to run with sound
	AudSetCallback(RunGetNextSound);
	AudSoundPlay();

	RunReset();

	return 0;
}
Exemplo n.º 4
0
static int RunInit()
{
	// Try to run with sound
    if (bSoundOn) {
        AudSetCallback(RunGetNextSound);
        AudSoundPlay();
    } else {
        bAudOkay=0;
        AudSetCallback(NULL);
    }
	RunReset();
    
	return 0;
}
Exemplo n.º 5
0
int DrvInit(int nDrvNum, bool bRestore)
{
	DrvExit();						// Make sure exitted
//	AudSoundInit();						// Init Sound (not critical if it fails)

	nBurnSoundRate = 0;					// Assume no sound
	pBurnSoundOut = NULL;
//	if (bAudOkay) {
//		nBurnSoundRate = nAudSampleRate;
//		nBurnSoundLen = nAudSegLen;
//	}
	nBurnDrvSelect[0] = nDrvNum;		// Set the driver number

	// Define nMaxPlayers early; GameInpInit() needs it (normally defined in DoLibInit()).
	nMaxPlayers = BurnDrvGetMaxPlayers();
//	GameInpInit();					// Init game input

//	ConfigGameLoad(true);
//	InputMake(true);

//	GameInpDefault();
SndInit();

	if (DoLibInit()) {				// Init the Burn library's driver
		char szTemp[512];

		BurnDrvExit();				// Exit the driver

		_stprintf (szTemp, _T("There was an error starting '%s'.\n"), BurnDrvGetText(DRV_FULLNAME));
		return 1;
	}

	BurnExtLoadRom = DrvLoadRom;

	bDrvOkay = 1;					// Okay to use all BurnDrv functions

	bSaveRAM = false;
	nBurnLayer = 0xFF;				// show all layers

	// Reset the speed throttling code, so we don't 'jump' after the load
	RunReset();
	return 0;
}
Exemplo n.º 6
0
void run_fba_emulator(const char *fn)
{
	char build_version[] = "Finalburn Alpha Plus for Pi  ("__DATE__")";

	// process rom path and name
	char romname[MAX_PATH];
	if (BurnCacheInit(fn, romname))
		goto finish;

	if(config_options.option_showfps)
		bShowFPS=true;

	BurnLibInit();
	
	// find rom by name
	for (nBurnDrvSelect=0; nBurnDrvSelect<nBurnDrvCount; nBurnDrvSelect++)
		if ( strcasecmp(romname, BurnDrvGetTextA(DRV_NAME)) == 0 )
			break;
	if (nBurnDrvSelect >= nBurnDrvCount) {
		// unsupport rom ...
		nBurnDrvSelect = ~0U;
		logoutput ("rom not supported!\n");
		printf ("rom not supported!\n");
		goto finish;
	}
	
	logoutput("Attempt to initialise '%s'\n", BurnDrvGetTextA(DRV_FULLNAME));
	
	memset (titlefb, 0, 320*240*2);
	DrawString (build_version, (uint16*)&titlefb, 10, 20, 320);
	DrawString ("Based on FinalBurnAlpha", (uint16*)&titlefb, 10, 35, 320);
	DrawString ("Now loading ... ", (uint16 *)&titlefb, 10, 105, 320);	
	show_rom_loading_text("Open Zip", 0, 0);
	memcpy (VideoBuffer, titlefb, 320*240*2); 
	pi_video_flip();
	 	
	InpInit();
	InpDIP();
	
	VideoInit();

	if (DrvInit(nBurnDrvSelect, false) != 0) {
		logoutput ("Driver initialisation failed! Likely causes are:\n- Corrupt/Missing ROM(s)\n- I/O Error\n- Memory error\n\n");
		printf ("Driver initialisation failed! Likely causes are:\n- Corrupt/Missing ROM(s)\n- I/O Error\n- Memory error\n\n");
		goto finish;
	}

	RunReset();

	frame_count = 0;
	GameLooping = true;

	EZX_StartTicks();

	logoutput ("Lets go!\n");
	logflush();

	if (config_options.option_sound_enable)
	{
		int timer = 0, tick=0, i=0, fps = 0;
		bool bRenderFrame;

		if (SndOpen() == 0)
		{		
			while (GameLooping)
			{
					if (bShowFPS)
					{
						timer = EZX_GetTicks();
						if(timer-tick>1000000)
						{
							fps = nFramesRendered;
							nFramesRendered = 0;
							tick = timer;
						}
					}
					//We need to render more audio:  
		
					bRenderFrame=true; // Render last frame
					RunOneFrame(bRenderFrame,fps);

					update_audio_stream(pBurnSoundOut);
					pi_process_events();
			}
		}
	}
	else
	{
		int now, done=0, timer = 0, ticks=0, tick=0, i=0, fps = 0;
		unsigned int frame_limit = nBurnFPS/100, frametime = 100000000/nBurnFPS;
		
		while (GameLooping)
		{
			timer = EZX_GetTicks()/frametime;;
			if(timer-tick>frame_limit && bShowFPS)
			{
				fps = nFramesRendered;
				nFramesRendered = 0;
				tick = timer;
			}
			now = timer;
			ticks=now-done;
			if(ticks<1) continue;
			if(ticks>10) ticks=10;
			for (i=0; i<ticks-1; i++)
			{
				RunOneFrame(false,fps);	
			} 
			if(ticks>=1)
			{
				RunOneFrame(true,fps);	
			}
			
			done = now;
		}
	}
	
	logoutput ("Finished emulating\n");
	
finish:
	logoutput("---- Shutdown Finalburn Alpha plus ----\n\n");
	DrvExit();
	BurnLibExit();

	if (config_options.option_sound_enable)
		SndExit();
	VideoExit();
	InpExit();
	BurnCacheExit();
}
Exemplo n.º 7
0
//#define NEED_MEDIA_REINIT
// no need to reinit media when init a driver, modified by regret
int BurnerDrvInit(int nDrvNum, bool bRestore)
{
	BurnerDrvExit();				// Make sure exitted

#ifdef NEED_MEDIA_REINIT
	mediaExit();
#endif

	nBurnDrvSelect = nDrvNum;		// Set the driver number

#ifdef NEED_MEDIA_REINIT
	mediaInit();
#endif
	//audio.init();
	mediaInit();
	// Define nMaxPlayers early; GameInpInit() needs it (normally defined in DoLibInit()).
	nMaxPlayers = BurnDrvGetMaxPlayers();

	GameInpInit();					// Init game input
	if (ConfigGameLoad(true)) {
		loadDefaultInput();			// load default input mapping
	}
	InputMake(true);
	GameInpDefault();

 
	// set functions
	BurnReinitScrn = scrnReinit;

#ifndef NO_IPS
//	bDoPatch = true; // play with ips
//	loadActivePatches();
//	BurnApplyPatch = applyPatches;
#endif

#ifndef NO_COMBO
	BurnInitCombo = ConstructComboList;
	BurnProcessCombo = ProcessCombo;
#endif

#ifndef NO_AUTOFIRE
//	BurnInitAutofire = initAutofire;
//	BurnDoAutofire = doAutofire;
#endif

	int nStatus = DoLibInit();		// Init the Burn library's driver
	if (nStatus) {
		if (nStatus & 2) {
			BurnDrvExit();			// Exit the driver

			//scrnTitle();
 		}

		return 1;
	}

/*	if (nInputMacroEnabled) {
		GameInpExit();
		GameInpInit();				// ReInit game input
		if (ConfigGameLoad(true)) {
			loadDefaultInput();		// load default input mapping
		}
		InputMake(true);
		GameInpDefault();
	}*/

	// ==> for changing sound track
	//parseTracklist();
	// <==

	BurnExtLoadRom = DrvLoadRom;

	bDrvOkay = 1;					// Okay to use all BurnDrv functions

	bSaveRAM = false;
 		if (bRestore) {
			StatedAuto(0);
			bSaveRAM = true;

			//configCheatLoad();
		}
 

	// Reset the speed throttling code, so we don't 'jump' after the load
	RunReset();
 
	return 0;
}
Exemplo n.º 8
0
int DrvInit(int nDrvNum, bool bRestore)
{
	int nStatus;
	
	DrvExit();						// Make sure exitted
	MediaExit();

	nBurnDrvActive = nDrvNum;		// Set the driver number
	
	if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_MVS) {

		BurnExtCartridgeSetupCallback = DrvCartridgeAccess;

		if (SelMVSDialog()) {
			POST_INITIALISE_MESSAGE;
			return 0;
		}
	}

	if ((BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_SNK_NEOCD) {
		if (CDEmuInit()) {
			FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_CDEMU_INI_FAIL));
			FBAPopupDisplay(PUF_TYPE_ERROR);

			POST_INITIALISE_MESSAGE;
			return 0;
		}
	}

	MediaInit();

	// Define nMaxPlayers early; GameInpInit() needs it (normally defined in DoLibInit()).
	nMaxPlayers = BurnDrvGetMaxPlayers();
	GameInpInit();					// Init game input

	if(ConfigGameLoad(true)) {
		ConfigGameLoadHardwareDefaults();
	}	
	InputMake(true);
	GameInpDefault();

	if (kNetGame) {
		nBurnCPUSpeedAdjust = 0x0100;
	}

	nStatus = DoLibInit();			// Init the Burn library's driver
	if (nStatus) {
		if (nStatus & 2) {
			BurnDrvExit();			// Exit the driver

			ScrnTitle();

			FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_BURN_INIT), BurnDrvGetText(DRV_FULLNAME));
			FBAPopupDisplay(PUF_TYPE_WARNING);
		}

		POST_INITIALISE_MESSAGE;
		return 1;
	}

	BurnExtLoadRom = DrvLoadRom;

	bDrvOkay = 1;						// Okay to use all BurnDrv functions

	if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) {
		nScreenSize = nScreenSizeVer;
		bVidArcaderes = bVidArcaderesVer;
		nVidWidth	= nVidVerWidth;
		nVidHeight	= nVidVerHeight;
	} else {
		nScreenSize = nScreenSizeHor;
		bVidArcaderes = bVidArcaderesHor;
		nVidWidth	= nVidHorWidth;
		nVidHeight	= nVidHorHeight;
	}

	bSaveRAM = false;
	if (kNetGame) {
		KailleraInitInput();
		KailleraGetInput();
	} else {
		if (bRestore) {
			StatedAuto(0);
			bSaveRAM = true;

			ConfigCheatLoad();
		}
	}

	nBurnLayer = 0xFF;				// show all layers
	
	// Reset the speed throttling code, so we don't 'jump' after the load
	RunReset();

	VidExit();
	POST_INITIALISE_MESSAGE;

	return 0;
}