void WiimoteSettingsPage::Load() {
  QSettings s;
  s.beginGroup(WiimotedevShortcuts::kSettingsGroup);
  ui_->wiimotedev_enable->setChecked(s.value("enabled", false).toBool());
  ui_->wiimotedev_active->setChecked(
      s.value("use_active_action", true).toBool());
  ui_->wiimotedev_focus->setChecked(
      s.value("only_when_focused", false).toBool());
  ui_->wiimotedev_notification->setChecked(
      s.value("use_notification", true).toBool());
  ui_->wiimotedev_device->setValue(s.value("device", 1).toUInt());
  bool first_conf = s.value("first_conf", true).toBool();
  s.endGroup();

  if (first_conf) {
    DefaultSettings();
    return;
  }

  s.beginGroup(WiimotedevShortcuts::kActionsGroup);
  ui_->list->clear();
  actions_.clear();

  quint64 fvalue, svalue;
  bool fvalid, svalid;

  for (const QString& str : s.allKeys()) {
    fvalue = str.toULongLong(&fvalid, 10);
    svalue = s.value(str, 0).toULongLong(&svalid);
    if (fvalid && svalid) AddShortcut(fvalue, svalue);
  }
  s.endGroup();

  ui_->list->sortItems(1, Qt::AscendingOrder);
}
Example #2
0
int LoadSettings(LPSETTINGS pSettings)
{
  ConfigDb *cfg = GetConfigFile();
  if (!cfg)
  {
    DefaultSettings(pSettings);
  }
  else
  {  
    int bRet = (aud_cfg_db_get_int(cfg,CUBE_CONFIG_TAG,LOOPCOUNT_NAME,&pSettings->loopcount) && 
		aud_cfg_db_get_int(cfg,CUBE_CONFIG_TAG,FADESECOND_NAME,&pSettings->fadeseconds) &&
		aud_cfg_db_get_int(cfg,CUBE_CONFIG_TAG,FADEDELAYSECOND_NAME,&pSettings->fadedelayseconds));
    
    aud_cfg_db_close(cfg); 
    
    // check if reading one value failed.  If so, then use defaults
    if (!bRet)
      DefaultSettings(pSettings);
  }
  return 1;
}
CFilterScript::CFilterScript(CProjectDoc* Doc):CPackagerFilter(Doc)
{
	m_Type = FILTER_SCRIPT;
	DefaultSettings();
	
	m_Game = ::new CAdGame;
	//m_Game->DEBUG_DebugEnable();
	m_Game->Initialize1();
	m_Game->m_ScEngine->SetCompileErrorCallback(ErrorCallback, this);

	m_CurrentFile = "";
}
Example #4
0
int
main(int argc, char *argv[])
{
	InitVideo(); // Initialize video
	SetupPads(); // Initialize input
	//InitAudio(); // Initialize audio
	fatInitDefault(); // Initialize file system
	InitFreeType((u8*)font_ttf, font_ttf_size); // Initialize font system
	InitGUIThreads(); // Initialize GUI

	DefaultSettings();
	MainMenu(MENU_SETTINGS);
}
Example #5
0
int main(int argc, char *argv[])
{
	xenon_make_it_faster(XENON_SPEED_FULL);
	InitVideo();
	
	usb_init();
	usb_do_poll();
	xenon_ata_init();
	
	xenon_sound_init();
	
	SetupPads();
	mount_all_devices();
	// Set defaults
	DefaultSettings(); 
	// Initialize font system
	InitFreeType((u8*)font_ttf, font_ttf_size); 
	
	browserList = (BROWSERENTRY *)malloc(sizeof(BROWSERENTRY)*MAX_BROWSER_SIZE);
		
	while (1) // main loop
	{
		MainMenu(MENU_GAMESELECTION);
		EmuLaunch();
		
		if(EmuRunning)
			MainMenu(MENU_GAME);
		else
			MainMenu(MENU_GAMESELECTION);		

		if(EmuRunning)
			EmuResume();
		else
			EmuLaunch();
		
		if(EmuConfigRequested) {				
			EmuConfigRequested = 0;
			break;
		}
		if(EmuResetRequested) {
			EmuResetRequested = 0;
			EmuReset();
		}
	}
	
	return 0;
}
Example #6
0
void
PreferencesMenu ()
{
	int ret = 0;
	int quit = 0;
	int oldmenu = menu;
	menu = 0;
	while (quit == 0)
	{
		ret = RunMenu (prefmenu, prefmenuCount, (char*)"Preferences");

		switch (ret)
		{
			case 0:
				ConfigureControllers ();
				break;

			case 1:
				VideoOptions ();
				break;

			case 2:
				FileOptions ();
				break;

			case 3:
				DefaultSettings ();
				WaitPrompt((char *)"Preferences Reset");
				break;

			case -1: /*** Button B ***/
			case 4:
				SavePrefs(GCSettings.SaveMethod, SILENT);
				quit = 1;
				break;

		}
	}
	menu = oldmenu;
}
Example #7
0
int InitVisionMemory(unsigned int res_x,unsigned int res_y)
{
    int i=0;
    if ( COLD_START == 1 )
     {
        // THIS MEANS THE WHOLE CORTEX JUST INITIALIZED , SO LETS CLEAN THE VIDEO REGISTERS
        for ( i=0; i<REGISTERS_COUNT; i++) video_register[i].pixels = 0;
        for ( i=0; i<LARGE_REGISTERS_COUNT; i++) l_video_register[i].pixels = 0;
     }

    COLD_START=0;

    //INITIALIZE ALL IMAGE METRICS
    metrics[RESOLUTION_X]=res_x;
    metrics[RESOLUTION_Y]=res_y;
    metrics[RESOLUTION_X_3_BYTE]=res_x * 3;
    metrics[RESOLUTION_MEMORY_LIMIT_1BYTE]=res_x*res_y;
    metrics[RESOLUTION_MEMORY_LIMIT_3BYTE]=metrics[RESOLUTION_MEMORY_LIMIT_1BYTE]*3;
    metrics[RESOLUTION_DEPTH]=3;
    metrics[CHANGES_LEFT]=0;
    metrics[CHANGES_RIGHT]=0;
    metrics[HORIZONTAL_BUFFER]=9; //20
    metrics[VERTICAL_BUFFER]=9; //25
    metrics[HORIZONTAL_BUFFER_LARGE]=15; //50
    metrics[VERTICAL_BUFFER_LARGE]=15; //75
    metrics[HORIZONTAL_BUFFER_EXTRALARGE]=21; //125
    metrics[VERTICAL_BUFFER_EXTRALARGE]=21; // 188
    metrics[GROUP_MOVEMENT_ARRAY_SIZE] = ( ((res_y+1)/metrics[VERTICAL_BUFFER])*((res_x+1)/metrics[HORIZONTAL_BUFFER]) ) + ((res_x+1)/metrics[HORIZONTAL_BUFFER]);



    DefaultSettings(); //Settings must be set after metrics because they take them into account

    fprintf(stderr,"Initializing %u  Video Register with %u MB , %u MB ( large ) , %u MB ( xlarge ) s\n",REGISTERS_COUNT+LARGE_REGISTERS_COUNT
                                                                                                        ,(unsigned int) ( 3*res_x*res_y*REGISTERS_COUNT*sizeof(char)) / 1048576
                                                                                                        ,(unsigned int) ( 3*res_x*res_y*LARGE_REGISTERS_COUNT*sizeof(unsigned short)) / 1048576
                                                                                                        ,(unsigned int) ( 3*res_x*res_y*LARGE_REGISTERS_COUNT*sizeof(unsigned int)) / 1048576
            );

    for ( i=0; i<REGISTERS_COUNT; i++)
     {
        if ( InitRegister(i,res_x,res_y,3)!=0 ) { fprintf(stderr,"Error initializing Vision Memory"); return 1; }
     }

     for ( i=0; i<LARGE_REGISTERS_COUNT; i++)
     {
        if ( InitLargeRegister(i,res_x,res_y,3)!=0 ) { fprintf(stderr,"Error initializing Vision Memory"); return 1; }
     }

     for ( i=0; i<EXTRA_LARGE_REGISTERS_COUNT; i++)
     {
        if ( InitExtraLargeRegister(i,res_x,res_y,3)!=0 ) { fprintf(stderr,"Error initializing Vision Memory"); return 1; }
     }


  //  unsigned int MEM3BIT = (res_x+1)*(res_y+1)*3;
    unsigned int MEM1BIT = (res_x+1)*(res_y+1);

    depth_data_array = ( struct DepthData * ) malloc ( sizeof(struct DepthData) * MEM1BIT );
    if (depth_data_array==0) { fprintf(stderr,"Error allocating depth_data_array memory \n"); return 1; }


    InitPrecalculations();

    SetGuardBytes(); // Preferably after everything settings..!


  return 0; // 0 Means Success!
}
Example #8
0
void
PreferencesMenu ()
{
	int ret = 0;
	int quit = 0;
	int oldmenu = menu;
	menu = 0;
	while (quit == 0)
	{
		// some load/save methods are not implemented - here's where we skip them
		// they need to be skipped in the order they were enumerated in vba.h

		// no USB ports on GameCube
		#ifdef HW_DOL
		if(GCSettings.LoadMethod == METHOD_USB)
			GCSettings.LoadMethod++;
		if(GCSettings.SaveMethod == METHOD_USB)
			GCSettings.SaveMethod++;
		#endif

		// saving to DVD is impossible
		if(GCSettings.SaveMethod == METHOD_DVD)
			GCSettings.SaveMethod++;

		// disable DVD in GC mode (not implemented)
		#ifdef HW_DOL
		if(GCSettings.LoadMethod == METHOD_DVD)
			GCSettings.LoadMethod++;
		#endif

		// disable SMB in GC mode (stalls out)
		#ifdef HW_DOL
		if(GCSettings.LoadMethod == METHOD_SMB)
			GCSettings.LoadMethod++;
		if(GCSettings.SaveMethod == METHOD_SMB)
			GCSettings.SaveMethod++;
		#endif

		// disable MC saving in Wii mode - does not work for some reason!
		#ifdef HW_RVL
		if(GCSettings.SaveMethod == METHOD_MC_SLOTA)
			GCSettings.SaveMethod++;
		if(GCSettings.SaveMethod == METHOD_MC_SLOTB)
			GCSettings.SaveMethod++;
		prefmenu[6][0] = 0;
		#else
		sprintf (prefmenu[6], "Verify MC Saves %s", GCSettings.VerifySaves == true ? " ON" : "OFF");
		#endif

		// correct load/save methods out of bounds
		if(GCSettings.LoadMethod > 4)
			GCSettings.LoadMethod = 0;
		if(GCSettings.SaveMethod > 6)
			GCSettings.SaveMethod = 0;

		if (GCSettings.LoadMethod == METHOD_AUTO) sprintf (prefmenu[0],"Load Method AUTO");
		else if (GCSettings.LoadMethod == METHOD_SD) sprintf (prefmenu[0],"Load Method SD");
		else if (GCSettings.LoadMethod == METHOD_USB) sprintf (prefmenu[0],"Load Method USB");
		else if (GCSettings.LoadMethod == METHOD_DVD) sprintf (prefmenu[0],"Load Method DVD");
		else if (GCSettings.LoadMethod == METHOD_SMB) sprintf (prefmenu[0],"Load Method Network");

		sprintf (prefmenu[1], "Load Folder %s",	GCSettings.LoadFolder);

		if (GCSettings.SaveMethod == METHOD_AUTO) sprintf (prefmenu[2],"Save Method AUTO");
		else if (GCSettings.SaveMethod == METHOD_SD) sprintf (prefmenu[2],"Save Method SD");
		else if (GCSettings.SaveMethod == METHOD_USB) sprintf (prefmenu[2],"Save Method USB");
		else if (GCSettings.SaveMethod == METHOD_SMB) sprintf (prefmenu[2],"Save Method Network");
		else if (GCSettings.SaveMethod == METHOD_MC_SLOTA) sprintf (prefmenu[2],"Save Method MC Slot A");
		else if (GCSettings.SaveMethod == METHOD_MC_SLOTB) sprintf (prefmenu[2],"Save Method MC Slot B");

		sprintf (prefmenu[3], "Save Folder %s",	GCSettings.SaveFolder);

		// disable changing load/save directories for now
		prefmenu[1][0] = '\0';
		prefmenu[3][0] = '\0';

		if (GCSettings.AutoLoad == 0) sprintf (prefmenu[4],"Auto Load OFF");
		else if (GCSettings.AutoLoad == 1) sprintf (prefmenu[4],"Auto Load SRAM");
		else if (GCSettings.AutoLoad == 2) sprintf (prefmenu[4],"Auto Load SNAPSHOT");

		if (GCSettings.AutoSave == 0) sprintf (prefmenu[5],"Auto Save OFF");
		else if (GCSettings.AutoSave == 1) sprintf (prefmenu[5],"Auto Save SRAM");
		else if (GCSettings.AutoSave == 2) sprintf (prefmenu[5],"Auto Save SNAPSHOT");
		else if (GCSettings.AutoSave == 3) sprintf (prefmenu[5],"Auto Save BOTH");

		sprintf (prefmenu[7], "Enable Zooming %s",
			GCSettings.Zoom == true ? " ON" : "OFF");

		// original mode not implemented
		if(GCSettings.render == 0)
			GCSettings.render++;

		if (GCSettings.render == 0)
			sprintf (prefmenu[8], "Video Rendering Original");
		if (GCSettings.render == 1)
			sprintf (prefmenu[8], "Video Rendering Filtered");
		if (GCSettings.render == 2)
			sprintf (prefmenu[8], "Video Rendering Unfiltered");

		sprintf (prefmenu[9], "Video Scaling %s",
			GCSettings.widescreen == true ? "16:9 Correction" : "Default");

		ret = RunMenu (prefmenu, prefmenuCount, (char*)"Preferences", 16);

		switch (ret)
		{
			case 0:
				GCSettings.LoadMethod ++;
				break;

			case 1:
				break;

			case 2:
				GCSettings.SaveMethod ++;
				break;

			case 3:
				break;

			case 4:
				GCSettings.AutoLoad ++;
				if (GCSettings.AutoLoad > 2)
					GCSettings.AutoLoad = 0;
				break;

			case 5:
				GCSettings.AutoSave ++;
				if (GCSettings.AutoSave > 3)
					GCSettings.AutoSave = 0;
				break;

			case 6:
				GCSettings.VerifySaves ^= 1;
				break;

			case 7:
				GCSettings.Zoom ^= 1;
				break;

			case 8:
				GCSettings.render++;
				if (GCSettings.render > 2)
					GCSettings.render = 0;
				// reset zoom
				zoom_reset ();
				break;

			case 9:
				GCSettings.widescreen ^= 1;
				break;

			case 10:
				DefaultSettings ();
				WaitPrompt((char *)"Preferences Reset");
				break;

			case 11:
			case -1: /*** Button B ***/
				SavePrefs(GCSettings.SaveMethod, SILENT);
				quit = 1;
				break;

		}
	}
	menu = oldmenu;
}
WiimoteSettingsPage::WiimoteSettingsPage(SettingsDialog* dialog)
    : SettingsPage(dialog), ui_(new Ui_WiimoteSettingsPage) {
  ui_->setupUi(this);
  ui_->list->header()->setResizeMode(QHeaderView::ResizeToContents);
  setWindowIcon(IconLoader::Load("wiimotedev", IconLoader::Base));

  text_buttons_.insert(WIIMOTE_BTN_1, "Wiiremote 1");
  text_buttons_.insert(WIIMOTE_BTN_2, "Wiiremote 2");
  text_buttons_.insert(WIIMOTE_BTN_A, "Wiiremote A");
  text_buttons_.insert(WIIMOTE_BTN_B, "Wiiremote B");
  text_buttons_.insert(WIIMOTE_BTN_PLUS, "Wiiremote Plus");
  text_buttons_.insert(WIIMOTE_BTN_MINUS, "Wiiremote Minus");
  text_buttons_.insert(WIIMOTE_BTN_HOME, "Wiiremote Home");
  text_buttons_.insert(WIIMOTE_BTN_UP, "Wiiremote Up");
  text_buttons_.insert(WIIMOTE_BTN_DOWN, "Wiiremote Down");
  text_buttons_.insert(WIIMOTE_BTN_LEFT, "Wiiremote Left");
  text_buttons_.insert(WIIMOTE_BTN_RIGHT, "Wiiremote Right");
  text_buttons_.insert(WIIMOTE_BTN_SHIFT_UP, "Wiiremote Shift Up");
  text_buttons_.insert(WIIMOTE_BTN_SHIFT_DOWN, "Wiiremote Shift Down");
  text_buttons_.insert(WIIMOTE_BTN_SHIFT_LEFT, "Wiiremote Shift Left");
  text_buttons_.insert(WIIMOTE_BTN_SHIFT_RIGHT, "Wiiremote Shift Right");
  text_buttons_.insert(WIIMOTE_BTN_SHIFT_FORWARD, "Wiiremote Shift Forward");
  text_buttons_.insert(WIIMOTE_BTN_SHIFT_BACKWARD, "Wiiremote Shift Backward");
  text_buttons_.insert(WIIMOTE_BTN_TILT_FRONT, "Wiiremote Tilt Front");
  text_buttons_.insert(WIIMOTE_BTN_TILT_BACK, "Wiiremote Tilt Back");
  text_buttons_.insert(WIIMOTE_BTN_TILT_LEFT, "Wiiremote Tilt Left");
  text_buttons_.insert(WIIMOTE_BTN_TILT_RIGHT, "Wiiremote Tilt Right");
  text_buttons_.insert(NUNCHUK_BTN_Z, "Nunchuk Z");
  text_buttons_.insert(NUNCHUK_BTN_C, "Nunchuk B");
  text_buttons_.insert(NUNCHUK_BTN_STICK_UP, "Nunchuk Stick Up");
  text_buttons_.insert(NUNCHUK_BTN_STICK_DOWN, "Nunchuk Stick Down");
  text_buttons_.insert(NUNCHUK_BTN_STICK_LEFT, "Nunchuk Stick Left");
  text_buttons_.insert(NUNCHUK_BTN_STICK_RIGHT, "Nunchuk Stick Right");
  text_buttons_.insert(NUNCHUK_BTN_SHIFT_UP, "Nunchuk Shift Up");
  text_buttons_.insert(NUNCHUK_BTN_SHIFT_DOWN, "Nunchuk Shift Down");
  text_buttons_.insert(NUNCHUK_BTN_SHIFT_LEFT, "Nunchuk Shift Left");
  text_buttons_.insert(NUNCHUK_BTN_SHIFT_RIGHT, "Nunchuk Shift Right");
  text_buttons_.insert(NUNCHUK_BTN_SHIFT_FORWARD, "Nunchuk Shift Forward");
  text_buttons_.insert(NUNCHUK_BTN_SHIFT_BACKWARD, "Nunchuk Shift Backward");
  text_buttons_.insert(NUNCHUK_BTN_TILT_FRONT, "Nunchuk Tilt Front");
  text_buttons_.insert(NUNCHUK_BTN_TILT_BACK, "Nunchuk Tilt Back");
  text_buttons_.insert(NUNCHUK_BTN_TILT_LEFT, "Nunchuk Tilt Left");
  text_buttons_.insert(NUNCHUK_BTN_TILT_RIGHT, "Nunchuk Tilt Right");
  text_buttons_.insert(CLASSIC_BTN_X, "Classic X");
  text_buttons_.insert(CLASSIC_BTN_Y, "Classic Y");
  text_buttons_.insert(CLASSIC_BTN_A, "Classic A");
  text_buttons_.insert(CLASSIC_BTN_B, "Classic B");
  text_buttons_.insert(CLASSIC_BTN_L, "Classic L");
  text_buttons_.insert(CLASSIC_BTN_R, "Classic R");
  text_buttons_.insert(CLASSIC_BTN_ZL, "Classic ZL");
  text_buttons_.insert(CLASSIC_BTN_ZR, "Classic ZR");
  text_buttons_.insert(CLASSIC_BTN_MINUS, "Classic Minus");
  text_buttons_.insert(CLASSIC_BTN_PLUS, "Classic Plus");
  text_buttons_.insert(CLASSIC_BTN_HOME, "Classic Home");
  text_buttons_.insert(CLASSIC_BTN_UP, "Classic Up");
  text_buttons_.insert(CLASSIC_BTN_DOWN, "Classic Down");
  text_buttons_.insert(CLASSIC_BTN_LEFT, "Classic Left");
  text_buttons_.insert(CLASSIC_BTN_RIGHT, "Classic Right");
  text_buttons_.insert(CLASSIC_BTN_LSTICK_UP, "Classic Left-Stick Up");
  text_buttons_.insert(CLASSIC_BTN_LSTICK_DOWN, "Classic Left-Stick Down");
  text_buttons_.insert(CLASSIC_BTN_LSTICK_LEFT, "Classic Left-Stick Left");
  text_buttons_.insert(CLASSIC_BTN_LSTICK_RIGHT, "Classic Left-Stick Right");
  text_buttons_.insert(CLASSIC_BTN_RSTICK_UP, "Classic Right-Stick Up");
  text_buttons_.insert(CLASSIC_BTN_RSTICK_DOWN, "Classic Right-Stick Down");
  text_buttons_.insert(CLASSIC_BTN_RSTICK_LEFT, "Classic Right-Stick Left");
  text_buttons_.insert(CLASSIC_BTN_RSTICK_RIGHT, "Classic Right-Stick Right");
  text_buttons_.insert(WIIMOTE_BTN_SHIFT_SHAKE, "Wiiremote Shift Shake");
  text_buttons_.insert(NUNCHUK_BTN_SHIFT_SHAKE, "Nunchuk Shift Shake");

  text_actions_.insert(WiimotedevShortcuts::WiimotedevActiveDeactive,
                       tr("Active/deactive Wiiremote"));
  text_actions_.insert(WiimotedevShortcuts::PlayerNextTrack, tr("Next track"));
  text_actions_.insert(WiimotedevShortcuts::PlayerPreviousTrack,
                       tr("Previous track"));
  text_actions_.insert(WiimotedevShortcuts::PlayerPlay, tr("Play"));
  text_actions_.insert(WiimotedevShortcuts::PlayerStop, tr("Stop"));
  text_actions_.insert(WiimotedevShortcuts::PlayerIncVolume,
                       tr("Increase volume"));
  text_actions_.insert(WiimotedevShortcuts::PlayerDecVolume,
                       tr("Decrease volume"));
  text_actions_.insert(WiimotedevShortcuts::PlayerMute, tr("Mute"));
  text_actions_.insert(WiimotedevShortcuts::PlayerPause, tr("Pause"));
  text_actions_.insert(WiimotedevShortcuts::PlayerTogglePause,
                       tr("Play/Pause"));
  text_actions_.insert(WiimotedevShortcuts::PlayerSeekBackward,
                       tr("Seek backward"));
  text_actions_.insert(WiimotedevShortcuts::PlayerSeekForward,
                       tr("Seek forward"));
  text_actions_.insert(WiimotedevShortcuts::PlayerStopAfter, tr("Stop after"));
  text_actions_.insert(WiimotedevShortcuts::PlayerShowOSD, tr("Show OSD"));

  connect(ui_->list,
          SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
          SLOT(ItemClicked(QTreeWidgetItem*)));

  connect(ui_->wiimotedev_add_action, SIGNAL(clicked()), this,
          SLOT(AddAction()));
  connect(ui_->wiimotedev_delete_action, SIGNAL(clicked()), this,
          SLOT(DeleteAction()));
  connect(ui_->wiimotedev_reload, SIGNAL(clicked()), this,
          SLOT(DefaultSettings()));
}
Example #10
0
int main(int argc, char *argv[])
{
	#ifdef HW_DOL
	ipl_set_config(6); // disable Qoob modchip
	#endif

	#ifdef WII_DVD
	DI_Init();	// first
	#endif

	int selectedMenu = -1;

	InitDeviceThread();

	InitGCVideo ();
	ResetVideo_Menu (); // change to menu video mode

	// Controllers
	PAD_Init();

	#ifdef HW_RVL
	WPAD_Init();
	// read wiimote accelerometer and IR data
	WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
	WPAD_SetVRes(WPAD_CHAN_ALL,640,480);

	// Wii Power/Reset buttons
	WPAD_SetPowerButtonCallback((WPADShutdownCallback)ShutdownCB);
	SYS_SetPowerCallback(ShutdownCB);
	SYS_SetResetCallback(ResetCB);
	#endif

	// Initialise FreeType
	if (FT_Init ())
	{
		printf ("Cannot initialise font subsystem!\n");
		while (1);
	}

	InitialiseAudio();

	// Initialize libFAT for SD and USB
	MountAllFAT();

	// Initialize DVD subsystem (GameCube only)
	#ifdef HW_DOL
	DVD_Init ();
	#endif

	// allocate memory to store rom
	nesrom = (unsigned char *)malloc(1024*1024*3); // 3 MB should be plenty

	/*** Minimal Emulation Loop ***/
	if ( !FCEUI_Initialize() )
	{
		WaitPrompt("Unable to initialize FCE Ultra\n");
		ExitToLoader();
	}

	FCEUI_SetGameGenie(0); // 0 - OFF, 1 - ON

	memset(FDSBIOS, 0, sizeof(FDSBIOS)); // clear FDS BIOS memory
	cleanSFMDATA(); // clear state data

	// Set defaults
	DefaultSettings();

	// store path app was loaded from
	sprintf(appPath, "fceugx");
	if(argc > 0 && argv[0] != NULL)
		CreateAppPath(argv[0]);

	// Load preferences
	if(!LoadPrefs())
	{
		WaitPrompt("Preferences reset - check settings!");
		selectedMenu = 1; // change to preferences menu
	}

	FCEUI_SetSoundQuality(1); // 0 - low, 1 - high, 2 - high (alt.)
	FCEUI_SetVidSystem(GCSettings.timing); // causes a small 'pop' in the audio

    while (1) // main loop
    {
		#ifdef HW_RVL
		if(ShutdownRequested)
			ShutdownWii();
		#endif

		// go back to checking if devices were inserted/removed
		// since we're entering the menu
		LWP_ResumeThread (devicethread);

    	MainMenu(selectedMenu);
		selectedMenu = 2; // return to game menu from now on

		// stop checking if devices were removed/inserted
		// since we're starting emulation again
		LWP_SuspendThread (devicethread);

		ResetVideo_Emu();

		setFrameTimer(); // set frametimer method before emulation
		SetPalette();

		static int fskipc=0;

		while(1) // emulation loop
		{
			uint8 *gfx;
			int32 *sound;
			int32 ssize;

			#ifdef FRAMESKIP
			fskipc=(fskipc+1)%(frameskip+1);
			#endif

			FCEUI_Emulate(&gfx, &sound, &ssize, fskipc);

			if(!fskipc)
			{
				xbsave = gfx;
				FCEUD_Update(gfx, sound, ssize);
			}

			if(ResetRequested)
			{
				PowerNES(); // reset game
				ResetRequested = 0;
			}

			if(ConfigRequested)
			{
				ResetVideo_Menu();
				if (GCSettings.AutoSave == 1)
				{
					SaveRAM(GCSettings.SaveMethod, SILENT);
				}
				else if (GCSettings.AutoSave == 2)
				{
					SaveState(GCSettings.SaveMethod, SILENT);
				}
				else if(GCSettings.AutoSave == 3)
				{
					SaveRAM(GCSettings.SaveMethod, SILENT);
					SaveState(GCSettings.SaveMethod, SILENT);
				}

				// save zoom level
				SavePrefs(SILENT);

				ConfigRequested = 0;
				break; // leave emulation loop
			}
		}
    }
}
Example #11
0
s32 main(s32 argc, const char* argv[])
{
    atexit(unload_modules);

    InitVideo(); // Initialize video
    SetupPads(); // Initialize input
#ifdef TOPORT
    InitAudio(); // Initialize audio
    fatInitDefault(); // Initialize file system
#endif
#ifdef TOPORT
    InitFreeType((u8*)font_ttf, font_ttf_size); // Initialize font system
    InitGUIThreads(); // Initialize GUI
    DefaultSettings();
    MainMenu(MENU_SETTINGS);
#endif

#ifdef PSL1GHT

    if(SysLoadModule(SYSMODULE_FS)!=0) return 0;
    else module_flag |=1;

    if(SysLoadModule(SYSMODULE_PNGDEC)!=0) return 0;
    else module_flag |=2;

#endif
    VideoModule * video = VideoModule::getVideoModule();

    InputPadModule * inpad = InputPadModule::getInputPadModule();

#ifdef PSL1GHT
    PngDatas png1;

    LoadPNG(&png1, (char *)"/dev_usb/PS3_GAME/ICON0.PNG");
#endif


    long frame = 0; // To keep track of how many frames we have rendered.

    int x = DEBUG_X, y = DEBUG_Y;


    // Ok, everything is setup. Now for the main loop.
    while(1) {
        char str [300];
        sprintf(str, "Pad number : %d, frame %d", (int) inpad->getPadNumber(),(int)frame);

        inpad->refreshPadConnections();
        // Check the pads.
        for( size_t i = 0; i < inpad->getPadNumber(); i++)
        {
            if( inpad->getPad(i)->isPressed( eAbsButUp) && y > 0)
                y--;
            if( inpad->getPad(i)->isPressed( eAbsButDown) && y < 1080)
                y++;
            if( inpad->getPad(i)->isPressed( eAbsButLeft) && x > 0)
                x--;
            if( inpad->getPad(i)->isPressed( eAbsButRight) && x > 0)
                x++;
            else if( inpad->getPad(i)->isPressed( eAbsButExecute))
                return 0;
        }
        sprintf(str, "Pad number : %d, frame %d", (int) inpad->getPadNumber(),(int)frame);

        video->waitFlip(); // Wait for the last flip to finish, so we can draw to the old buffer

#ifdef PSL1GHT
        drawFrame(video->getCurrentBuffer(), frame++); // Draw into the unused buffer

        if(png1.bmp_out) {
            video->displayBitmap( (u32 *)png1.bmp_out, png1.height, png1.width, png1.wpitch);
        }
#endif
        video->printf(x, y, str);

        video->flip(); // Flip buffer onto screen
    }

    return 0;
}
CFilterCopy::CFilterCopy(CProjectDoc* Doc):CPackagerFilter(Doc)
{
	m_Type = FILTER_COPY;
	DefaultSettings();
}
CFilterExclude::CFilterExclude(CProjectDoc* Doc):CPackagerFilter(Doc)
{
	m_Type = FILTER_EXCLUDE;
	DefaultSettings();
}
Example #14
0
bool LoadPrefs()
{
    if (prefLoaded) // already attempted loading
        return true;

    char filepath[MAXPATHLEN];
    sprintf(filepath, "%s/%s", MPLAYER_DATADIR, PREF_FILE_NAME);

    TiXmlDocument doc;

    bool loadOkay = doc.LoadFile(filepath);
    if (loadOkay) {
        FixInvalidSettings();
        TiXmlHandle docu(&doc);
        TiXmlElement* settings = docu.FirstChildElement().Element();
        if (settings == NULL) {
            goto noheader;
        }
        TiXmlHandle handle(0);
        TiXmlElement* elem;
        handle = TiXmlHandle(settings);
        elem = handle.FirstChild("global").FirstChild().Element();
        for (elem; elem; elem = elem->NextSiblingElement()) {
            const char* elemName = elem->Value();
            if (strcmp(elemName, "exit") == 0) {
                XMPlayerCfg.exit_action = atoi(elem->Attribute("value"));
            } else if (strcmp(elemName, "language") == 0) {
                XMPlayerCfg.language = atoi(elem->Attribute("value"));
            }
        }
        elem = handle.FirstChild("filebrowser").FirstChild().Element();
        for (elem; elem; elem = elem->NextSiblingElement()) {
            const char* elemName = elem->Value();
            if (strcmp(elemName, "sort") == 0) {
                XMPlayerCfg.sort_order = atoi(elem->Attribute("value"));
            }
        }
        elem = handle.FirstChild("audio").FirstChild().Element();
        for (elem; elem; elem = elem->NextSiblingElement()) {
            const char* elemName = elem->Value();
            if (strcmp(elemName, "language") == 0) {
                sprintf(XMPlayerCfg.alang, elem->Attribute("value"));
                sprintf(XMPlayerCfg.alang_desc, elem->Attribute("desc"));
            } else if (strcmp(elemName, "volume") == 0) {
                XMPlayerCfg.volume = atoi(elem->Attribute("value"));
            } else if (strcmp(elemName, "softvol") == 0) {
                XMPlayerCfg.softvol = atoi(elem->Attribute("value"));
            }
        }
        elem = handle.FirstChild("video").FirstChild().Element();
        for (elem; elem; elem = elem->NextSiblingElement()) {
            const char* elemName = elem->Value();
            if (strcmp(elemName, "framedrop") == 0) {
                XMPlayerCfg.framedrop = atoi(elem->Attribute("value"));
            } else if (strcmp(elemName, "vsync") == 0) {
                XMPlayerCfg.vsync = atoi(elem->Attribute("value"));
            }
        }
        elem = handle.FirstChild("subtitles").FirstChild().Element();
        for (elem; elem; elem = elem->NextSiblingElement()) {
            const char* elemName = elem->Value();
            if (strcmp(elemName, "sub_color") == 0) {
                elem->Attribute("value", &XMPlayerCfg.subcolor);
            } else if (strcmp(elemName, "border_color") == 0) {
                elem->Attribute("value", &XMPlayerCfg.border_color);
            } else if (strcmp(elemName, "codepage") == 0) {
                sprintf(XMPlayerCfg.subcp, elem->Attribute("value"));
                sprintf(XMPlayerCfg.subcp_desc, elem->Attribute("desc"));
            } else if (strcmp(elemName, "language") == 0) {
                sprintf(XMPlayerCfg.sublang, elem->Attribute("value"));
                sprintf(XMPlayerCfg.sublang_desc, elem->Attribute("desc"));
            }
        }
        doc.Clear();
        prefLoaded = true;

        printf("[Preferences] Sucessfully loaded xmplayer.xml \n");
        return true;

    } else {
noheader:
        DefaultSettings();
        printf("[Preferences] Failed to load xmplayer.xml - Loading default settings \n");
        return false;
    }

}