示例#1
0
文件: fceu.c 项目: ficoos/fceu-next
void PowerNES(void)
{
	if(!FCEUGameInfo)
		return;

	FCEU_CheatResetRAM();
	FCEU_CheatAddRAM(2,0,RAM);

	GeniePower();

#ifndef COPYFAMI
	FCEU_MemoryRand(RAM,0x800);
#endif

	SetReadHandler(0x0000,0xFFFF,ANull);
	SetWriteHandler(0x0000,0xFFFF,BNull);

#ifdef COPYFAMI
	SetReadHandler(0,0x3FFF,ARAML);
	SetWriteHandler(0,0x3FFF,BRAML);
#else
	SetReadHandler(0,0x7FF,ARAML);
	SetWriteHandler(0,0x7FF,BRAML);

	SetReadHandler(0x800,0x1FFF,ARAMH);  /* Part of a little */
	SetWriteHandler(0x800,0x1FFF,BRAMH); /* hack for a small speed boost. */
#endif
	InitializeInput();
	FCEUSND_Power();
	FCEUPPU_Power();

	/* Have the external game hardware "powered" after the internal NES stuff.
	   Needed for the NSF code and VS System code.
	 */
	GameInterface(GI_POWER);
	if(FCEUGameInfo->type==GIT_VSUNI)
		FCEU_VSUniPower();


	timestampbase=0;
	X6502_Power();
	FCEU_PowerCheats();
}
示例#2
0
void PowerNES(void) 
{
        MDFNMOV_AddCommand(MDFN_MSC_POWER);

        if(!MDFNGameInfo)
	 return;

	if(!Genie_BIOSInstalled())
 	 MDFNMP_RemoveReadPatches();

	MDFNMP_AddRAM(0x0800, 0x0000, RAM);

	// Genie_Power() will remove any cheat read patches, and then install the BIOS(and its read hooks)
        Genie_Power();

	// http://wiki.nesdev.com/w/index.php/CPU_power_up_state
	memset(RAM, 0xFF, 0x800);
	RAM[0x008] = 0xF7;
	RAM[0x009] = 0xEF;
	RAM[0x00A] = 0xDF;
	RAM[0x00F] = 0xBF;

        NESINPUT_Power();
        MDFNSND_Power();
        MDFNPPU_Power();

	/* Have the external game hardware "powered" after the internal NES stuff.  
	   Needed for the NSF code and VS System code.
	*/
	if(GameInterface->Power)
	 GameInterface->Power();

	if(NESIsVSUni)
         MDFN_VSUniPower();

	timestampbase = 0;
	X6502_Power();

        if(!Genie_BIOSInstalled())
         MDFNMP_InstallReadPatches();
}