コード例 #1
0
ファイル: libretro.cpp プロジェクト: producerblock/vba-next
static void gba_init(void)
{
   cpuSaveType = 0;
   flashSize = 0x10000;
   enableRtc = false;
   mirroringEnable = false;

   load_image_preferences();

   if(flashSize == 0x10000 || flashSize == 0x20000)
      flashSetSize(flashSize);

   if(enableRtc)
      rtcEnable(enableRtc);

   doMirroring(mirroringEnable);

   soundSetSampleRate(32000);

   CPUInit(0, false);
   CPUReset();

   soundReset();

   uint8_t * state_buf = (uint8_t*)malloc(2000000);
   serialize_size = CPUWriteState(state_buf, 2000000);
   free(state_buf);
}
コード例 #2
0
static void gba_init(void)
{
   cpuSaveType = 0;
   flashSize = 0x10000;
   enableRtc = false;
   mirroringEnable = false;
#ifdef FRONTEND_SUPPORTS_RGB565
   systemColorDepth = 16;
   systemRedShift = 11;
   systemGreenShift = 6;
   systemBlueShift = 0;
#else
   systemColorDepth = 32;
   systemRedShift = 19;
   systemGreenShift = 11;
   systemBlueShift = 3;
#endif


   utilUpdateSystemColorMaps(false);
   
   if (cpuSaveType == 0)
      utilGBAFindSave(size);
   else
      saveType = cpuSaveType;

   load_image_preferences();

   if(flashSize == 0x10000 || flashSize == 0x20000)
      flashSetSize(flashSize);

   if(enableRtc)
      rtcEnable(enableRtc);

   doMirroring(mirroringEnable);

   soundInit();
   soundSetSampleRate(32000);

   CPUInit(0, false);
   CPUReset();

   soundReset();

   uint8_t * state_buf = (uint8_t*)malloc(2000000);
   serialize_size = CPUWriteState(state_buf, 2000000);
   free(state_buf);

   emulating = 1;
}
コード例 #3
0
gboolean savestate_save_to_file(const gchar *file, GError **err) {
	g_return_val_if_fail(err == NULL || *err == NULL, FALSE);

	gzFile gzFile = gzopen(file, "wb");
	if (gzFile == NULL) {
		g_set_error(err, SAVESTATE_ERROR, G_SAVESTATE_ERROR_FAILED,
				"Failed to save state: %s", g_strerror(errno));
		return FALSE;
	}

	CPUWriteState(gzFile);

	gzclose(gzFile);

	return TRUE;
}
コード例 #4
0
bool retro_serialize(void *data, size_t size)
{
   return CPUWriteState((uint8_t*)data, size);
}