Example #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;
}
Example #2
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;
}
Example #3
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;
}
Example #4
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;
}