예제 #1
0
static void Change3DCoreWithFallback(int newCore)
{
   if( (newCore < 0)
#ifdef HAVE_OPENGL
         || (newCore > GPU3D_OPENGL_OLD)
#endif
         )
      newCore = GPU3D_SWRAST;

   printf("Attempting change to 3d core to: %s\n",core3DList[newCore]->name);

#ifdef HAVE_OPENGL
   if(newCore == GPU3D_OPENGL_OLD)
      goto TRY_OGL_OLD;
#endif

   if(newCore == GPU3D_SWRAST)
      goto TRY_SWRAST;

   if(newCore == GPU3D_NULL)
   {
      NDS_3D_ChangeCore(GPU3D_NULL);
      cur3DCore = GPU3D_NULL;
      goto DONE;
   }

#ifdef HAVE_OPENGL
   if(!NDS_3D_ChangeCore(GPU3D_OPENGL_3_2))
   {
      printf("falling back to 3d core: %s\n",core3DList[GPU3D_OPENGL_OLD]->name);
      cur3DCore = GPU3D_OPENGL_3_2;
      goto TRY_OGL_OLD;
   }
#endif
   goto DONE;

#ifdef HAVE_OPENGL
TRY_OGL_OLD:
   if(!NDS_3D_ChangeCore(GPU3D_OPENGL_OLD))
   {
      printf("falling back to 3d core: %s\n",core3DList[GPU3D_SWRAST]->name);
      cur3DCore = GPU3D_OPENGL_OLD;
      goto TRY_SWRAST;
   }
   goto DONE;

#endif
TRY_SWRAST:
   cur3DCore = GPU3D_SWRAST;
   NDS_3D_ChangeCore(GPU3D_SWRAST);

DONE:
   (void)0;
}
예제 #2
0
void EMU_init()
{
	//oglrender_init = android_opengl_init;
	
	path.ReadPathSettings();
	if (video.layout > 2)
	{
		video.layout = video.layout_old = 0;
	}
	
	EMU_loadSettings();
    
	Desmume_InitOnce();
	//gpu_SetRotateScreen(video.rotation);
	NDS_FillDefaultFirmwareConfigData(&fw_config);
	//Hud.reset();
	
	INFO("Init NDS");
	/*
	switch (slot1_device_type)
	{
		case NDS_SLOT1_NONE:
		case NDS_SLOT1_RETAIL:
		case NDS_SLOT1_R4:
		case NDS_SLOT1_RETAIL_NAND:
			break;
		default:
			slot1_device_type = NDS_SLOT1_RETAIL;
			break;
	}
	*/
	switch (addon_type)
	{
        case NDS_ADDON_NONE:
            break;
        case NDS_ADDON_CFLASH:
            break;
        case NDS_ADDON_RUMBLEPAK:
            break;
        case NDS_ADDON_GBAGAME:
            if (!strlen(GBAgameName))
            {
                addon_type = NDS_ADDON_NONE;
                break;
            }
            // TODO: check for file exist
            break;
        case NDS_ADDON_GUITARGRIP:
            break;
        case NDS_ADDON_EXPMEMORY:
            break;
        case NDS_ADDON_PIANO:
            break;
        case NDS_ADDON_PADDLE:
            break;
        default:
            addon_type = NDS_ADDON_NONE;
            break;
	}
    
	//!slot1Change((NDS_SLOT1_TYPE)slot1_device_type);
	addonsChangePak(addon_type);
    
	NDS_Init();
	
	//osd->singleScreen = true;
	cur3DCore = 1;
	NDS_3D_ChangeCore(cur3DCore); //OpenGL
	
	LOG("Init sound core\n");
	SPU_ChangeSoundCore(SNDCORE_COREAUDIO, DESMUME_SAMPLE_RATE*8/60);
	
	static const char* nickname = "emozilla";
	fw_config.nickname_len = strlen(nickname);
	for(int i = 0 ; i < fw_config.nickname_len ; ++i)
		fw_config.nickname[i] = nickname[i];
    
	static const char* message = "nds4ios makes you happy!";
	fw_config.message_len = strlen(message);
	for(int i = 0 ; i < fw_config.message_len ; ++i)
		fw_config.message[i] = message[i];
	
	fw_config.language = 1;
    
	video.setfilter(video.NONE);
	
	NDS_CreateDummyFirmware(&fw_config);
	
	InitSpeedThrottle();
	
	mainLoopData.freq = 1000;
	mainLoopData.lastticks = GetTickCount();
}
예제 #3
0
void EMU_change3D(int type)
{
	NDS_3D_ChangeCore(cur3DCore = type);
}
예제 #4
0
파일: emu.cpp 프로젝트: DD4ve/iNDS
void EMU_init(int lang)
{
	//oglrender_init = android_opengl_init;
	
	path.ReadPathSettings();
	if (video.layout > 2)
	{
		video.layout = video.layout_old = 0;
	}
	
	EMU_loadSettings();
    
	Desmume_InitOnce();
	//gpu_SetRotateScreen(video.rotation);
	NDS_FillDefaultFirmwareConfigData(&fw_config);
	//Hud.reset();
	
	INFO("Init NDS");
	/*
	switch (slot1_device_type)
	{
		case NDS_SLOT1_NONE:
		case NDS_SLOT1_RETAIL:
		case NDS_SLOT1_R4:
		case NDS_SLOT1_RETAIL_NAND:
			break;
		default:
			slot1_device_type = NDS_SLOT1_RETAIL;
			break;
	}
	*/
	switch (addon_type)
	{
        case NDS_ADDON_NONE:
            break;
        case NDS_ADDON_CFLASH:
            break;
        case NDS_ADDON_RUMBLEPAK:
            break;
        case NDS_ADDON_GBAGAME:
            if (!strlen(GBAgameName))
            {
                addon_type = NDS_ADDON_NONE;
                break;
            }
            // TODO: check for file exist
            break;
        case NDS_ADDON_GUITARGRIP:
            break;
        case NDS_ADDON_EXPMEMORY:
            break;
        case NDS_ADDON_PIANO:
            break;
        case NDS_ADDON_PADDLE:
            break;
        default:
            addon_type = NDS_ADDON_NONE;
            break;
	}
    
	//!slot1Change((NDS_SLOT1_TYPE)slot1_device_type);
	addonsChangePak(addon_type);
    
	NDS_Init();
	
	//osd->singleScreen = true;
	cur3DCore = 1;
	NDS_3D_ChangeCore(cur3DCore); //OpenGL
	
	LOG("Init sound core\n");
	SPU_ChangeSoundCore(SNDCORE_COREAUDIO, DESMUME_SAMPLE_RATE*8/60);
	
	static const char* nickname = "iNDS"; //TODO: Add firmware cfg in settings
	fw_config.nickname_len = strlen(nickname);
	for(int i = 0 ; i < fw_config.nickname_len ; ++i)
		fw_config.nickname[i] = nickname[i];
    
	static const char* message = "iNDS is the best!";
	fw_config.message_len = strlen(message);
	for(int i = 0 ; i < fw_config.message_len ; ++i)
		fw_config.message[i] = message[i];
	
	fw_config.language = lang < 0 ? NDS_FW_LANG_ENG : lang;
	fw_config.fav_colour = 15;
	fw_config.birth_month = 2;
	fw_config.birth_day = 17;
	fw_config.ds_type = NDS_CONSOLE_TYPE_LITE;
    
	video.setfilter(video.NONE); //figure out why this doesn't seem to work (also add to cfg)
	
	NDS_CreateDummyFirmware(&fw_config);
	
	InitSpeedThrottle();
	
	mainLoopData.freq = 1000;
	mainLoopData.lastticks = GetTickCount();
}