Exemple #1
0
int DrvInit(int nDrvNum, bool bRestore)
{
	int nStatus;
    bDrvOkay = 0;
	
	DrvExit();						// Make sure exitted
	nBurnDrvActive = nDrvNum;		// Set the driver number

    nMaxPlayers = BurnDrvGetMaxPlayers();
    GameInpInit();					// Init game input
    if (ConfigGameLoad(true)) {
        ConfigGameLoadHardwareDefaults();
    }
    InputMake(true);
    GameInpDefault();

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



	BurnExtLoadRom = DrvLoadRom;

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

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

	nBurnLayer = 0xFF;				// show all layers
	
	// Reset the speed throttling code, so we don't 'jump' after the load
    //RunReset();
	VidExit();
	return 0;
}
Exemple #2
0
static int GetInput(bool bCopy)
{
	static int i = 0;
	InputMake(bCopy); 						// get input

	// Update Input dialog ever 3 frames
	if (i == 0) {
		InpdUpdate();
	}

	i++;

	if (i >= 3) {
		i = 0;
	}

	// Update Input Set dialog
	InpsUpdate();
	return 0;
}
Exemple #3
0
static int GetInput()
{
	static int i=0;
	InputMake(); // get input

	// Update Input + Cheat dialogs ever 3 frames
	if (i==0)
	{
		InpdUpdate();
	}
	i++;
	if (i>=3)
	{
		i=0;
	}

	// Update Input Set dialog
	InpsUpdate();
	return 0;
}
Exemple #4
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;
}
Exemple #5
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;
}