示例#1
0
文件: mmc3.cpp 项目: Nolaan/fceux
void GenMMC3Power(void) {
	if (UNIFchrrama) setchr8(0);

	SetWriteHandler(0x8000, 0xBFFF, MMC3_CMDWrite);
	SetWriteHandler(0xC000, 0xFFFF, MMC3_IRQWrite);
	SetReadHandler(0x8000, 0xFFFF, CartBR);

// KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support
	SetWriteHandler(0x5000,0x5FFF, KT008HackWrite);

	A001B = A000B = 0;
	setmirror(1);
	if (mmc3opts & 1) {
		if (WRAMSIZE == 1024) {
			FCEU_CheatAddRAM(1, 0x7000, WRAM);
			SetReadHandler(0x7000, 0x7FFF, MAWRAMMMC6);
			SetWriteHandler(0x7000, 0x7FFF, MBWRAMMMC6);
		} else {
			FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
			SetWriteHandler(0x6000, 0x6000 + ((WRAMSIZE - 1) & 0x1fff), CartBW);
			SetReadHandler(0x6000, 0x6000 + ((WRAMSIZE - 1) & 0x1fff), CartBR);
			setprg8r(0x10, 0x6000, 0);
		}
		if (!(mmc3opts & 2))
			FCEU_dwmemset(WRAM, 0, WRAMSIZE);
	}
	MMC3RegReset();
	if (CHRRAM)
		FCEU_dwmemset(CHRRAM, 0, CHRRAMSIZE);
}
示例#2
0
文件: mmc3.cpp 项目: Plombo/fceux
void GenMMC3Power(void) {
	if (UNIFchrrama) setchr8(0);

	SetWriteHandler(0x8000, 0xBFFF, MMC3_CMDWrite);
	SetWriteHandler(0xC000, 0xFFFF, MMC3_IRQWrite);
	SetReadHandler(0x8000, 0xFFFF, CartBR);
	A001B = A000B = 0;
	setmirror(1);
	if (mmc3opts & 1) {
		if (WRAMSIZE == 1024) {
			FCEU_CheatAddRAM(1, 0x7000, WRAM);
			SetReadHandler(0x7000, 0x7FFF, MAWRAMMMC6);
			SetWriteHandler(0x7000, 0x7FFF, MBWRAMMMC6);
		} else {
			FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
			SetWriteHandler(0x6000, 0x6000 + ((WRAMSIZE - 1) & 0x1fff), CartBW);
			SetReadHandler(0x6000, 0x6000 + ((WRAMSIZE - 1) & 0x1fff), CartBR);
			setprg8r(0x10, 0x6000, 0);
		}
		if (!(mmc3opts & 2))
			FCEU_dwmemset(WRAM, 0, WRAMSIZE);
	}
	MMC3RegReset();
	if (CHRRAM)
		FCEU_dwmemset(CHRRAM, 0, CHRRAMSIZE);
}
示例#3
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();
}