Пример #1
0
void UNLSB2000_Init(CartInfo *info) {
	info->Reset = UNLSB2000Reset;
	info->Power = UNLSB2000Power;
	info->Close = UNLSB2000Close;
//	GameHBIRQHook = UNLSB2000IRQHook;
	GameStateRestore = StateRestore;
/*
	CHRRAMSIZE = 8192;
	CHRRAM = (uint8*)FCEU_gmalloc(CHRRAMSIZE);
	SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSIZE, 1);
	AddExState(CHRRAM, CHRRAMSIZE, 0, "CRAM");
*/

//	SetupCartCHRMapping(0, PRGptr[0], PRGsize[0], 0);

	WRAMSIZE = 512 * 1024;
	WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
	SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
	AddExState(WRAM, WRAMSIZE, 0, "WRAM");
	if (info->battery) {
		info->SaveGame[0] = WRAM;
		info->SaveGameLen[0] = WRAMSIZE;
	}

	AddExState(&StateRegs, ~0, 0, 0);
}
Пример #2
0
void Mapper111_Init(CartInfo *info) {
	info->Power = M111Power;
	info->Close = M111Close;

	CHRRAM = (uint8*)FCEU_gmalloc(CHRRAMSIZE);
	SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSIZE, 1);

	GameStateRestore = StateRestore;
	AddExState(&StateRegs, ~0, 0, 0);
	AddExState(CHRRAM, CHRRAMSIZE, 0, "CRAM");

	flash = (info->battery != 0);
	if (flash)
	{
		FLASHROM = (uint8*)FCEU_gmalloc(FLASHROMSIZE);
		info->SaveGame[0] = FLASHROM;
		info->SaveGameLen[0] = FLASHROMSIZE;
		AddExState(FLASHROM, FLASHROMSIZE, 0, "FROM");
		AddExState(&FlashRegs, ~0, 0, 0);

		// copy PRG ROM into FLASHROM, use it instead of PRG ROM
		const uint32 PRGSIZE = ROM_size * 16 * 1024;
		for (uint32 w=0, r=0; w<FLASHROMSIZE; ++w)
		{
			FLASHROM[w] = ROM[r];
			++r;
			if (r >= PRGSIZE) r = 0;
		}
		SetupCartPRGMapping(0x10, FLASHROM, FLASHROMSIZE, 0);
	}
}
Пример #3
0
static void Latch_Init(CartInfo *info, void (*proc)(void), readfunc func, uint16 linit, uint16 adr0, uint16 adr1, uint8 wram) {
	latcheinit = linit;
	addrreg0 = adr0;
	addrreg1 = adr1;
	WSync = proc;
	if (func != NULL)
		defread = func;
	else
		defread = CartBROB;
	info->Power = LatchPower;
	info->Reset = LatchReset;
	info->Close = LatchClose;
	if (wram) {
		WRAMSIZE = 8192;
		WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
		SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
		if (info->battery) {
			info->SaveGame[0] = WRAM;
			info->SaveGameLen[0] = WRAMSIZE;
		}
		AddExState(WRAM, WRAMSIZE, 0, "WRAM");
	}
	GameStateRestore = StateRestore;
	AddExState(&latche, 2, 0, "LATC");
}
Пример #4
0
void Mapper163_Init(CartInfo *info)
{
    info->Power=Power2;
    GameHBIRQHook=M163HB;
    GameStateRestore=StateRestore;
    AddExState(&StateRegs, ~0, 0, 0);
    AddExState(WRAM, 8192, 0, "WRAM");
}
Пример #5
0
void Mapper112_Init(CartInfo *info)
{
  info->Power=M112Power;
  info->Close=M112Close;
  GameStateRestore=StateRestore;
  WRAM=(uint8*)malloc(8192);
  SetupCartPRGMapping(0x10,WRAM,8192,1);
  AddExState(WRAM, 8192, 0, "WRAM");
  AddExState(&StateRegs, ~0, 0, 0);
}
Пример #6
0
void Mapper168_Init(CartInfo *info) {
	info->Power = M168Power;
	info->Close = MNNNClose;
	GameStateRestore = StateRestore;
	AddExState(&StateRegs, ~0, 0, 0);

	CHRRAMSIZE = 8192 * 8;
	CHRRAM = (uint8*)FCEU_gmalloc(CHRRAMSIZE);
	SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSIZE, 1);
	AddExState(CHRRAM, CHRRAMSIZE, 0, "CRAM");
}
Пример #7
0
void UNLSHeroes_Init(CartInfo *info) {
	GenMMC3_Init(info, 256, 512, 0, 0);
	cwrap = MSHCW;
	info->Power = MSHPower;
	info->Reset = MSHReset;
	info->Close = MSHClose;
	CHRRAM = (uint8*)FCEU_gmalloc(8192);
	SetupCartCHRMapping(0x10, CHRRAM, 8192, 1);
	AddExState(EXPREGS, 4, 0, "EXPR");
	AddExState(&tekker, 1, 0, "DIPSW");
}
Пример #8
0
void BMCFK23C_Init(CartInfo *info)
{
  GenMMC3_Init(info, 512, 256, 128, 0);
  cwrap=BMCFK23CCW;
  pwrap=BMCFK23CPW;
  info->Power=BMCFK23CPower;
  info->Reset=BMCFK23CReset;
  AddExState(EXPREGS, 8, 0, "EXPR");
  AddExState(&unromchr, 1, 0, "UCHR");
  AddExState(&dipswitch, 1, 0, "DPSW");
}
Пример #9
0
void UNLKS7030_Init(CartInfo *info) {
	info->Power = UNLKS7030Power;
	info->Close = UNLKS7030Close;
	GameStateRestore = StateRestore;

	WRAMSIZE = 8192;
	WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
	AddExState(WRAM, WRAMSIZE, 0, "WRAM");

	AddExState(&StateRegs, ~0, 0, 0);
}
Пример #10
0
void UNLSC127_Init(CartInfo *info) {
	info->Reset = UNLSC127Reset;
	info->Power = UNLSC127Power;
	info->Close = UNLSC127Close;
	GameHBIRQHook = UNLSC127IRQ;
	GameStateRestore = StateRestore;
	WRAMSIZE = 8192;
	WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
	SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
	AddExState(WRAM, WRAMSIZE, 0, "WRAM");
	AddExState(&StateRegs, ~0, 0, 0);
}
Пример #11
0
void Mapper96_init(void)
{
 SetWriteHandler(0x8000,0xffff,Mapper96_write);
 PPU_hook=M96Hook;
 AddExState(&latche, 1, 0, "LATC");
 AddExState(&M96LA, 1, 0, "LAVA");
 SetupCartCHRMapping(0x10, MapperExRAM, 32768, 1);
 latche=M96LA=0;
 M96Sync(0);
 setmirror(MI_0);
 GameStateRestore=M96Sync;
}
Пример #12
0
void LH32_Init(CartInfo *info) {
    info->Power = LH32Power;
    info->Close = LH32Close;

    WRAMSIZE = 8192;
    WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
    SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
    AddExState(WRAM, WRAMSIZE, 0, "WRAM");

    GameStateRestore = StateRestore;
    AddExState(&StateRegs, ~0, 0, 0);
}
Пример #13
0
void Mapper73_Init(CartInfo *info) {
	info->Power = M73Power;
	info->Close = M73Close;
	MapIRQHook = M73IRQHook;

	WRAMSIZE = 8192;
	WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
	SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
	AddExState(WRAM, WRAMSIZE, 0, "WRAM");

	AddExState(&StateRegs, ~0, 0, 0);
	GameStateRestore = StateRestore;
}
Пример #14
0
void Mapper199_Init(CartInfo *info)
{
  int CHRRAMSize=1024*8;
  GenMMC3_Init(info, 512, 256, 8, info->battery);
  cwrap=M199CW;
  pwrap=M199PW;
  mwrap=M199MW;
  info->Power=M199Power;
  CHRRAM=(uint8*)FCEU_gmalloc(CHRRAMSize);
  SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSize, 1);
  AddExState(CHRRAM, CHRRAMSize, 0, "CHRR");
  AddExState(EXPREGS, 4, 0, "EXPR");
}
Пример #15
0
void SSSNROM_Init(CartInfo *info) {
	info->Reset = SSSNROMReset;
	info->Power = SSSNROMPower;
	info->Close = SSSNROMClose;
	GameHBIRQHook = SSSNROMIRQHook;
	GameStateRestore = StateRestore;

	WRAMSIZE = 16384;
	WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
	SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
	AddExState(WRAM, WRAMSIZE, 0, "WRAM");
	AddExState(&StateRegs, ~0, 0, 0);
}
Пример #16
0
void Mapper34_Init(CartInfo *info) {
	info->Power = M34Power;
	info->Close = M34Close;
	GameStateRestore = StateRestore;

	WRAMSIZE = 8192;
	WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
	SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
	FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
	AddExState(WRAM, WRAMSIZE, 0, "WRAM");

	AddExState(&StateRegs, ~0, 0, 0);
}
Пример #17
0
void Super24_Init(CartInfo *info)
{
  GenMMC3_Init(info, 128, 256, 0, 0);
  info->Power=Super24Power;
  info->Reset=Super24Reset;
  info->Close=Super24Close;
  cwrap=Super24CW;
  pwrap=Super24PW;
  CHRRAM=(uint8*)FCEU_gmalloc(8192);
  SetupCartCHRMapping(0x10, CHRRAM, 8192, 1);
  AddExState(CHRRAM, 8192, 0, "CHRR");
  AddExState(EXPREGS, 3, 0, "BIG2");
}
Пример #18
0
void GenMMC3_Init(CartInfo *info, int prg, int chr, int wram, int battery)
{
 pwrap=GENPWRAP;
 cwrap=GENCWRAP;
 mwrap=GENMWRAP;

 wrams=wram<<10;

 PRGmask8[0]&=(prg>>13)-1;
 CHRmask1[0]&=(chr>>10)-1;
 CHRmask2[0]&=(chr>>11)-1;

 if(wram)
 {
  mmc3opts|=1;
  WRAM=(uint8*)FCEU_gmalloc(wrams);
  AddExState(WRAM, wrams, 0, "WRAM");
 }

 if(battery)
 {
  mmc3opts|=2;
  info->SaveGame[0]=WRAM;
  info->SaveGameLen[0]=wrams;
 }

// if(!chr) // duplicated CHR RAM set up
// {
//  CHRRAM=(uint8*)FCEU_gmalloc(8192);
//  CHRRAMSize=8192;
//  SetupCartCHRMapping(0, CHRRAM, 8192, 1);
//  AddExState(CHRRAM, 8192, 0, "CHRR");
// }

 AddExState(MMC3_StateRegs, ~0, 0, 0);

 info->Power=GenMMC3Power;
 info->Reset=MMC3RegReset;
 info->Close=GenMMC3Close;

 if(info->CRC32 == 0x5104833e)        // Kick Master
  GameHBIRQHook = MMC3_hb_KickMasterHack;
 else if(info->CRC32 == 0x5a6860f1 || info->CRC32 == 0xae280e20) // Shougi Meikan '92/'93
  GameHBIRQHook = MMC3_hb_KickMasterHack;
 else if(info->CRC32 == 0xfcd772eb)    // PAL Star Wars, similar problem as Kick Master.
  GameHBIRQHook = MMC3_hb_PALStarWarsHack;
 else
  GameHBIRQHook=MMC3_hb;
// PPU_hook=MMC3_PPU;
 GameStateRestore=GenMMC3Restore;
}
Пример #19
0
void UNLKS7037_Init(CartInfo *info) {
	info->Power = UNLKS7037Power;
	info->Close = Close;

	WSync = SyncKS7037;

	WRAMSIZE = 8192;
	WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
	SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
	AddExState(WRAM, WRAMSIZE, 0, "WRAM");

	GameStateRestore = StateRestore;
	AddExState(&StateRegs, ~0, 0, 0);
}
Пример #20
0
void UNLEDU2000_Init(CartInfo *info)
{
  info->Power=UNLEDU2000Power;
  info->Close=UNLEDU2000Close;
  GameStateRestore=UNLEDU2000Restore;
  WRAM=(uint8*)FCEU_gmalloc(32768);
  SetupCartPRGMapping(0x10,WRAM,32768,1);
  if(info->battery)
  {
    info->SaveGame[0]=WRAM;
    info->SaveGameLen[0]=32768;
  }
  AddExState(WRAM, 32768, 0, "WRAM");
  AddExState(StateRegs, ~0, 0, 0);
}
Пример #21
0
void Mapper199_Init(CartInfo *info) {
	GenMMC3_Init(info, 512, 256, 8, info->battery);
	cwrap = M199CW;
	pwrap = M199PW;
	mwrap = M199MW;
	info->Power = M199Power;
	info->Close = M199Close;

	CHRRAMSIZE = 8192;
	CHRRAM = (uint8*)FCEU_gmalloc(CHRRAMSIZE);
	SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSIZE, 1);
	AddExState(CHRRAM, CHRRAMSIZE, 0, "CHRR");

	AddExState(EXPREGS, 4, 0, "EXPR");
}
Пример #22
0
void Mapper82_Init(CartInfo *info) {
	info->Power = M82Power;
	info->Close = M82Close;

	WRAMSIZE = 8192;
	WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
	SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
	AddExState(WRAM, WRAMSIZE, 0, "WRAM");
	if (info->battery) {
		info->SaveGame[0] = WRAM;
		info->SaveGameLen[0] = WRAMSIZE;
	}
	GameStateRestore = StateRestore;
	AddExState(&StateRegs, ~0, 0, 0);
}
Пример #23
0
void BMC8IN1_Init(CartInfo *info) {
    GenMMC3_Init(info, 128, 128, 0, 0);
    cwrap = BMC8IN1CW;
    pwrap = BMC8IN1PW;
    info->Power = BMC8IN1Power;
    AddExState(EXPREGS, 1, 0, "EXPR");
}
Пример #24
0
void Mapper117_Init(CartInfo *info)
{
  info->Power=M117Power;
  GameHBIRQHook=M117IRQHook;
  GameStateRestore=StateRestore;
  AddExState(&StateRegs, ~0, 0, 0);
}
Пример #25
0
void BMCBS5_Init(CartInfo *info)
{
  info->Power=MBS5Power;
  info->Reset=MBS5Reset;
  GameStateRestore=StateRestore;
  AddExState(&StateRegs, ~0, 0, 0);
}
Пример #26
0
static int InitializeBoard(void)
{
   int x=0;

   if(!sboardname) return(0);

   while(bmap[x].name)
   {
    if(!strcmp(sboardname,(char *)bmap[x].name))
    {
     if(!malloced[16])
     {
      if(bmap[x].flags & BMCFLAG_16KCHRR)
        CHRRAMSize = 16384;
      else
  CHRRAMSize = 8192;
      if((UNIFchrrama=(uint8 *)FCEU_malloc(CHRRAMSize)))
      {
       SetupCartCHRMapping(0,UNIFchrrama,CHRRAMSize,1);
       AddExState(UNIFchrrama, CHRRAMSize, 0,"CHRR");
      }
      else
       return(-1);
     }
     if(bmap[x].flags&BMCFLAG_FORCE4)
      mirrortodo=4;
     MooMirroring();
     bmap[x].init(&UNIFCart);
     return(1);
    }
    x++;
   }
   FCEU_PrintError("Board type not supported.");
   return(0);
}
Пример #27
0
void UNLKS7013B_Init(CartInfo *info) {
	info->Power = UNLKS7013BPower;
	info->Reset = UNLKS7013BReset;

	GameStateRestore = StateRestore;
	AddExState(&StateRegs, ~0, 0, 0);
}
Пример #28
0
void UNLAX5705_Init(CartInfo *info)
{
  info->Power=UNLAX5705Power;
//  GameHBIRQHook=UNLAX5705IRQ;
  GameStateRestore=StateRestore;
  AddExState(&StateRegs, ~0, 0, 0);
}
Пример #29
0
void Mapper222_Init(CartInfo *info)
{
  info->Power=M222Power;
  GameHBIRQHook=M222IRQ;
  GameStateRestore=StateRestore;
  AddExState(&StateRegs, ~0, 0, 0);
}
Пример #30
0
void UNLKS7032_Init(CartInfo *info)
{
  info->Power=UNLKS7032Power;
  MapIRQHook=UNLSMB2JIRQHook;
  GameStateRestore=StateRestore;
  AddExState(&StateRegs, ~0, 0, 0);
}