Esempio n. 1
0
int UNIFLoad(const char *name, FCEUFILE *fp)
{
	FCEU_fseek(fp,0,SEEK_SET);
	FCEU_fread(&unhead,1,4,fp);
	if(memcmp(&unhead,"UNIF",4))
		return 0;

	ResetCartMapping();

	ResetExState(0,0);
	ResetUNIF();
	if(!FCEU_read32le(&unhead.info,fp))
		goto aborto;
	if(FCEU_fseek(fp,0x20,SEEK_SET)<0)
		goto aborto;
	if(!LoadUNIFChunks(fp))
		goto aborto;
	{
		int x;
		struct md5_context md5;

		md5_starts(&md5);

		for(x=0;x<32;x++)
			if(malloced[x])
			{
				md5_update(&md5,malloced[x],mallocedsizes[x]);
			}
			md5_finish(&md5,UNIFCart.MD5);
			FCEU_printf(" ROM MD5:  0x");
			for(x=0;x<16;x++)
				FCEU_printf("%02x",UNIFCart.MD5[x]);
			FCEU_printf("\n");
			memcpy(&GameInfo->MD5,&UNIFCart.MD5,sizeof(UNIFCart.MD5));
	}

	if(!InitializeBoard())
		goto aborto;

	#if !defined(GEKKO)|| !defined(_XBOX)
	FCEU_LoadGameSave(&UNIFCart);
	#endif

	strcpy(LoadedRomFName,name); //For the debugger list
	GameInterface=UNIFGI;
	return 1;

aborto:

	FreeUNIF();
	ResetUNIF();


	return 0;
}
Esempio n. 2
0
int UNIFLoad(const char *name, int fp)
{
        FCEU_fseek(fp,0,SEEK_SET);
        FCEU_fread(&unhead,1,4,fp);
        if(memcmp(&unhead,"UNIF",4))
         return 0;

	ResetCartMapping();

        ResetExState(0,0);
        ResetUNIF();
        if(!FCEU_read32(&unhead.info,fp))
	 goto aborto;
        if(FCEU_fseek(fp,0x20,SEEK_SET)<0)
	 goto aborto;
        if(!LoadUNIFChunks(fp))
	 goto aborto;
	{
	 int x;
	 struct md5_context md5;

	 md5_starts(&md5);

	 for(x=0;x<32;x++)
	  if(malloced[x])
	  {
	   md5_update(&md5,malloced[x],mallocedsizes[x]);
	  }
	  md5_finish(&md5,UNIFCart.MD5);
          FCEU_printf(" ROM MD5:  0x");
          for(x=0;x<16;x++)
           FCEU_printf("%02x",UNIFCart.MD5[x]);
          FCEU_printf("\n");
	  memcpy(FCEUGameInfo.MD5,UNIFCart.MD5,sizeof(UNIFCart.MD5));
	}

        if(!InitializeBoard())
	 goto aborto;

	FCEU_LoadGameSave(&UNIFCart);
        GameInterface=UNIFGI;
        return 1;

	aborto:

	FreeUNIF();
	ResetUNIF();


	return 0;
}
Esempio n. 3
0
int CopyFamiLoad() {
	ResetCartMapping();
	ResetExState(0, 0);

	sboardname = "COPYFAMI";
	if (!InitializeBoard())
		goto aborto;

	FCEU_LoadGameSave(&UNIFCart);
	GameInterface = UNIFGI;
	return 1;

 aborto:

	FreeUNIF();
	ResetUNIF();
	return 0;
}