2013-09-05 16:45:41 +00:00
// Copyright (c) 2013- PPSSPP Project.
2013-06-08 20:42:31 +00:00
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
2013-10-17 14:15:04 +00:00
# include "base/colorutil.h"
# include "base/timeutil.h"
# include "math/curves.h"
2013-06-08 20:42:31 +00:00
# include "gfx_es2/draw_buffer.h"
# include "i18n/i18n.h"
# include "ui/view.h"
# include "ui/viewgroup.h"
2013-07-17 20:27:05 +00:00
# include "ui/ui_context.h"
2013-06-08 20:42:31 +00:00
# include "UI/EmuScreen.h"
# include "UI/GameSettingsScreen.h"
# include "UI/GameInfoCache.h"
2013-11-29 15:46:47 +00:00
# include "UI/GamepadEmu.h"
2013-07-17 20:27:05 +00:00
# include "UI/MiscScreens.h"
2013-08-16 14:48:43 +00:00
# include "UI/ControlMappingScreen.h"
2013-09-07 11:38:37 +00:00
# include "UI/DevScreens.h"
2013-10-09 20:15:56 +00:00
# include "UI/TouchControlLayoutScreen.h"
2013-10-20 02:40:52 +00:00
# include "UI/TouchControlVisibilityScreen.h"
2013-10-27 17:58:47 +00:00
# include "UI/TiltAnalogSettingsScreen.h"
2013-09-07 11:38:37 +00:00
2013-06-08 20:42:31 +00:00
# include "Core/Config.h"
2013-09-04 19:00:00 +00:00
# include "Core/Host.h"
2013-08-14 12:44:36 +00:00
# include "Core/System.h"
2013-09-01 19:57:39 +00:00
# include "Core/Reporting.h"
2013-11-02 20:33:27 +00:00
# include "Core/MIPS/JitCommon/JitCommon.h"
2013-10-17 14:15:04 +00:00
# include "android/jni/TestRunner.h"
# include "GPU/GPUInterface.h"
2013-08-22 11:10:06 +00:00
# include "Common/KeyMap.h"
2013-07-30 14:28:34 +00:00
2013-08-04 07:39:49 +00:00
# ifdef _WIN32
namespace MainWindow {
extern HWND hwndMain ;
}
# endif
2013-11-29 15:46:47 +00:00
2013-08-17 21:49:06 +00:00
# ifdef IOS
2013-12-01 19:28:20 +00:00
extern bool iosCanUseJit ;
2013-08-17 21:49:06 +00:00
# endif
2013-08-04 07:39:49 +00:00
2013-08-18 20:48:53 +00:00
static const int alternateSpeedTable [ 9 ] = {
0 , 15 , 30 , 45 , 60 , 75 , 90 , 120 , 180
2013-08-18 16:53:45 +00:00
} ;
2013-06-08 20:42:31 +00:00
void GameSettingsScreen : : CreateViews ( ) {
GameInfo * info = g_gameInfoCache . GetInfo ( gamePath_ , true ) ;
2013-07-17 23:04:11 +00:00
cap60FPS_ = g_Config . iForceMaxEmulatedFPS = = 60 ;
2013-11-02 20:33:27 +00:00
showDebugStats_ = g_Config . bShowDebugStats ;
2013-10-28 15:04:53 +00:00
2013-08-18 16:53:45 +00:00
iAlternateSpeedPercent_ = 3 ;
for ( int i = 0 ; i < 8 ; i + + ) {
if ( g_Config . iFpsLimit < = alternateSpeedTable [ i ] ) {
iAlternateSpeedPercent_ = i ;
break ;
}
}
2013-07-17 23:04:11 +00:00
2013-06-08 20:42:31 +00:00
// Information in the top left.
// Back button to the bottom left.
// Scrolling action menu to the right.
using namespace UI ;
2013-09-03 08:42:26 +00:00
I18NCategory * d = GetI18NCategory ( " Dialog " ) ;
2013-06-08 20:42:31 +00:00
I18NCategory * gs = GetI18NCategory ( " Graphics " ) ;
2013-06-10 20:06:51 +00:00
I18NCategory * c = GetI18NCategory ( " Controls " ) ;
I18NCategory * a = GetI18NCategory ( " Audio " ) ;
I18NCategory * s = GetI18NCategory ( " System " ) ;
2013-08-11 15:25:50 +00:00
I18NCategory * ms = GetI18NCategory ( " MainSettings " ) ;
2013-09-04 11:59:19 +00:00
I18NCategory * dev = GetI18NCategory ( " Developer " ) ;
2013-06-08 20:42:31 +00:00
2013-08-17 11:08:32 +00:00
root_ = new AnchorLayout ( new LayoutParams ( FILL_PARENT , FILL_PARENT ) ) ;
2013-06-08 20:42:31 +00:00
2013-07-20 14:03:52 +00:00
ViewGroup * leftColumn = new AnchorLayout ( new LinearLayoutParams ( 1.0f ) ) ;
2013-06-08 20:42:31 +00:00
root_ - > Add ( leftColumn ) ;
2013-12-10 18:57:07 +00:00
root_ - > Add ( new Choice ( d - > T ( " Back " ) , " " , false , new AnchorLayoutParams ( 150 , 64 , 10 , NONE , NONE , 10 ) ) ) - > OnClick . Handle < UIScreen > ( this , & UIScreen : : OnBack ) ;
2013-06-08 20:42:31 +00:00
2013-08-17 11:08:32 +00:00
TabHolder * tabHolder = new TabHolder ( ORIENT_VERTICAL , 200 , new AnchorLayoutParams ( 10 , 0 , 10 , 0 , false ) ) ;
2013-07-21 16:03:54 +00:00
2013-06-08 20:42:31 +00:00
root_ - > Add ( tabHolder ) ;
// TODO: These currently point to global settings, not game specific ones.
2013-07-20 14:03:52 +00:00
// Graphics
2013-06-08 20:42:31 +00:00
ViewGroup * graphicsSettingsScroll = new ScrollView ( ORIENT_VERTICAL , new LinearLayoutParams ( FILL_PARENT , FILL_PARENT ) ) ;
2013-08-19 22:49:25 +00:00
LinearLayout * graphicsSettings = new LinearLayout ( ORIENT_VERTICAL ) ;
graphicsSettings - > SetSpacing ( 0 ) ;
2013-06-08 20:42:31 +00:00
graphicsSettingsScroll - > Add ( graphicsSettings ) ;
2013-08-11 15:25:50 +00:00
tabHolder - > AddTab ( ms - > T ( " Graphics " ) , graphicsSettingsScroll ) ;
2013-07-21 20:15:18 +00:00
graphicsSettings - > Add ( new ItemHeader ( gs - > T ( " Rendering Mode " ) ) ) ;
2013-08-30 09:22:29 +00:00
static const char * renderingMode [ ] = { " Non-Buffered Rendering " , " Buffered Rendering " , " Read Framebuffers To Memory (CPU) " , " Read Framebuffers To Memory (GPU) " } ;
2013-10-29 15:22:36 +00:00
graphicsSettings - > Add ( new PopupMultiChoice ( & g_Config . iRenderingMode , gs - > T ( " Mode " ) , renderingMode , 0 , ARRAY_SIZE ( renderingMode ) , gs , screenManager ( ) ) ) - > OnChoice . Handle ( this , & GameSettingsScreen : : OnRenderingMode ) ;
2013-08-18 21:11:47 +00:00
2013-08-18 17:51:40 +00:00
graphicsSettings - > Add ( new ItemHeader ( gs - > T ( " Frame Rate Control " ) ) ) ;
static const char * frameSkip [ ] = { " Off " , " Auto " , " 1 " , " 2 " , " 3 " , " 4 " , " 5 " , " 6 " , " 7 " , " 8 " } ;
2013-09-11 20:21:15 +00:00
graphicsSettings - > Add ( new PopupMultiChoice ( & g_Config . iFrameSkip , gs - > T ( " Frame Skipping " ) , frameSkip , 0 , ARRAY_SIZE ( frameSkip ) , gs , screenManager ( ) ) ) ;
2013-08-20 18:12:58 +00:00
graphicsSettings - > Add ( new CheckBox ( & cap60FPS_ , gs - > T ( " Force max 60 FPS (helps GoW) " ) ) ) ;
2013-08-18 20:48:53 +00:00
static const char * customSpeed [ ] = { " Unlimited " , " 25% " , " 50% " , " 75% " , " 100% " , " 125% " , " 150% " , " 200% " , " 300% " } ;
2013-09-11 20:21:15 +00:00
graphicsSettings - > Add ( new PopupMultiChoice ( & iAlternateSpeedPercent_ , gs - > T ( " Alternative Speed " ) , customSpeed , 0 , ARRAY_SIZE ( customSpeed ) , gs , screenManager ( ) ) ) ;
2013-09-30 09:57:30 +00:00
2013-07-17 20:27:05 +00:00
graphicsSettings - > Add ( new ItemHeader ( gs - > T ( " Features " ) ) ) ;
2013-10-30 10:28:14 +00:00
postProcChoice_ = graphicsSettings - > Add ( new Choice ( gs - > T ( " Postprocessing Shader " ) ) ) ;
postProcChoice_ - > OnClick . Handle ( this , & GameSettingsScreen : : OnPostProcShader ) ;
postProcChoice_ - > SetEnabled ( g_Config . iRenderingMode ! = 0 ) ;
2013-12-08 10:16:18 +00:00
# if defined(_WIN32) || defined(USING_QT_UI)
2013-10-20 15:33:18 +00:00
graphicsSettings - > Add ( new CheckBox ( & g_Config . bFullScreen , gs - > T ( " FullScreen " ) ) ) - > OnClick . Handle ( this , & GameSettingsScreen : : OnFullscreenChange ) ;
2013-10-04 19:31:40 +00:00
# endif
2013-06-08 20:42:31 +00:00
graphicsSettings - > Add ( new CheckBox ( & g_Config . bStretchToDisplay , gs - > T ( " Stretch to Display " ) ) ) ;
2013-11-28 04:59:17 +00:00
if ( pixel_xres < pixel_yres * 1.3 ) // Smaller than 4:3
2013-08-20 11:37:22 +00:00
graphicsSettings - > Add ( new CheckBox ( & g_Config . bPartialStretch , gs - > T ( " Partial Vertical Stretch " ) ) ) ;
2013-06-08 20:42:31 +00:00
graphicsSettings - > Add ( new CheckBox ( & g_Config . bMipMap , gs - > T ( " Mipmapping " ) ) ) ;
2013-10-20 15:33:18 +00:00
graphicsSettings - > Add ( new ItemHeader ( gs - > T ( " Performance " ) ) ) ;
# ifndef USING_GLES2
static const char * internalResolutions [ ] = { " Auto (1:1) " , " 1x PSP " , " 2x PSP " , " 3x PSP " , " 4x PSP " , " 5x PSP " , " 6x PSP " , " 7x PSP " , " 8x PSP " , " 9x PSP " , " 10x PSP " } ;
# else
static const char * internalResolutions [ ] = { " Auto (1:1) " , " 1x PSP " , " 2x PSP " , " 3x PSP " , " 4x PSP " , " 5x PSP " } ;
# endif
2013-10-30 11:12:14 +00:00
resolutionChoice_ = graphicsSettings - > Add ( new PopupMultiChoice ( & g_Config . iInternalResolution , gs - > T ( " Rendering Resolution " ) , internalResolutions , 0 , ARRAY_SIZE ( internalResolutions ) , gs , screenManager ( ) ) ) ;
resolutionChoice_ - > OnClick . Handle ( this , & GameSettingsScreen : : OnResolutionChange ) ;
resolutionChoice_ - > SetEnabled ( g_Config . iRenderingMode ! = 0 ) ;
2013-10-27 13:09:46 +00:00
# ifdef _WIN32
2013-10-20 15:33:18 +00:00
graphicsSettings - > Add ( new CheckBox ( & g_Config . bVSync , gs - > T ( " VSync " ) ) ) ;
2013-10-27 13:09:46 +00:00
# endif
2013-10-20 15:33:18 +00:00
graphicsSettings - > Add ( new CheckBox ( & g_Config . bHardwareTransform , gs - > T ( " Hardware Transform " ) ) ) ;
2013-11-10 12:18:52 +00:00
CheckBox * swSkin = graphicsSettings - > Add ( new CheckBox ( & g_Config . bSoftwareSkinning , gs - > T ( " Software Skinning " ) ) ) ;
2013-10-20 15:33:18 +00:00
graphicsSettings - > Add ( new CheckBox ( & g_Config . bVertexCache , gs - > T ( " Vertex Cache " ) ) ) ;
2013-11-29 13:20:37 +00:00
// Seems solid, so we hide the setting.
2013-12-04 09:46:05 +00:00
// CheckBox *vtxJit = graphicsSettings->Add(new CheckBox(&g_Config.bVertexDecoderJit, gs->T("Vertex Decoder JIT")));
2013-11-29 13:20:37 +00:00
2013-11-10 12:18:52 +00:00
if ( PSP_IsInited ( ) ) {
swSkin - > SetEnabled ( false ) ;
2013-12-04 09:46:05 +00:00
// vtxJit->SetEnabled(false);
2013-11-10 12:18:52 +00:00
}
2013-11-09 17:16:26 +00:00
2013-10-20 15:33:18 +00:00
graphicsSettings - > Add ( new CheckBox ( & g_Config . bLowQualitySplineBezier , gs - > T ( " LowCurves " , " Low quality spline/bezier curves " ) ) ) ;
2013-09-28 06:21:59 +00:00
// In case we're going to add few other antialiasing option like MSAA in the future.
2013-10-12 00:05:55 +00:00
// graphicsSettings->Add(new CheckBox(&g_Config.bFXAA, gs->T("FXAA")));
2013-07-20 14:03:52 +00:00
graphicsSettings - > Add ( new ItemHeader ( gs - > T ( " Texture Scaling " ) ) ) ;
2013-07-17 20:27:05 +00:00
# ifndef USING_GLES2
2013-10-11 14:33:02 +00:00
static const char * texScaleLevels [ ] = { " Auto " , " Off " , " 2x " , " 3x " , " 4x " , " 5x " } ;
2013-07-26 12:25:11 +00:00
# else
2013-10-11 14:33:02 +00:00
static const char * texScaleLevels [ ] = { " Auto " , " Off " , " 2x " , " 3x " } ;
2013-07-26 12:25:11 +00:00
# endif
2013-10-11 14:33:02 +00:00
graphicsSettings - > Add ( new PopupMultiChoice ( & g_Config . iTexScalingLevel , gs - > T ( " Upscale Level " ) , texScaleLevels , 0 , ARRAY_SIZE ( texScaleLevels ) , gs , screenManager ( ) ) ) ;
2013-07-17 23:04:11 +00:00
static const char * texScaleAlgos [ ] = { " xBRZ " , " Hybrid " , " Bicubic " , " Hybrid + Bicubic " , } ;
2013-09-11 20:21:15 +00:00
graphicsSettings - > Add ( new PopupMultiChoice ( & g_Config . iTexScalingType , gs - > T ( " Upscale Type " ) , texScaleAlgos , 0 , ARRAY_SIZE ( texScaleAlgos ) , gs , screenManager ( ) ) ) ;
2013-07-26 12:25:11 +00:00
graphicsSettings - > Add ( new CheckBox ( & g_Config . bTexDeposterize , gs - > T ( " Deposterize " ) ) ) ;
2013-07-20 14:03:52 +00:00
graphicsSettings - > Add ( new ItemHeader ( gs - > T ( " Texture Filtering " ) ) ) ;
2013-08-16 10:52:16 +00:00
static const char * anisoLevels [ ] = { " Off " , " 2x " , " 4x " , " 8x " , " 16x " } ;
2013-09-11 20:21:15 +00:00
graphicsSettings - > Add ( new PopupMultiChoice ( & g_Config . iAnisotropyLevel , gs - > T ( " Anisotropic Filtering " ) , anisoLevels , 0 , ARRAY_SIZE ( anisoLevels ) , gs , screenManager ( ) ) ) ;
2013-07-26 12:25:11 +00:00
static const char * texFilters [ ] = { " Auto " , " Nearest " , " Linear " , " Linear on FMV " , } ;
2013-09-11 20:21:15 +00:00
graphicsSettings - > Add ( new PopupMultiChoice ( & g_Config . iTexFiltering , gs - > T ( " Texture Filter " ) , texFilters , 1 , ARRAY_SIZE ( texFilters ) , gs , screenManager ( ) ) ) ;
2013-07-17 20:27:05 +00:00
2013-10-22 11:00:19 +00:00
graphicsSettings - > Add ( new ItemHeader ( gs - > T ( " Hack Settings " , " Hack Settings (these WILL cause glitches) " ) ) ) ;
2013-11-15 16:16:03 +00:00
graphicsSettings - > Add ( new CheckBox ( & g_Config . bTimerHack , gs - > T ( " Timer Hack " ) ) ) ;
2013-10-22 11:00:19 +00:00
// Maybe hide this on non-PVR?
graphicsSettings - > Add ( new CheckBox ( & g_Config . bDisableAlphaTest , gs - > T ( " Disable Alpha Test (PowerVR speedup) " ) ) ) - > OnClick . Handle ( this , & GameSettingsScreen : : OnShaderChange ) ;
2013-09-05 12:51:17 +00:00
graphicsSettings - > Add ( new CheckBox ( & g_Config . bDisableStencilTest , gs - > T ( " Disable Stencil Test " ) ) ) ;
graphicsSettings - > Add ( new CheckBox ( & g_Config . bAlwaysDepthWrite , gs - > T ( " Always Depth Write " ) ) ) ;
2013-10-09 08:44:12 +00:00
CheckBox * prescale = graphicsSettings - > Add ( new CheckBox ( & g_Config . bPrescaleUV , gs - > T ( " Texture Coord Speedhack " ) ) ) ;
if ( PSP_IsInited ( ) )
prescale - > SetEnabled ( false ) ;
2013-09-05 12:51:17 +00:00
2013-10-20 15:33:18 +00:00
graphicsSettings - > Add ( new ItemHeader ( gs - > T ( " Overlay Information " ) ) ) ;
2013-11-29 10:36:47 +00:00
static const char * fpsChoices [ ] = {
" None " , " Speed " , " FPS " , " Both "
2013-10-28 04:19:27 +00:00
# ifdef BLACKBERRY
2013-11-29 10:36:47 +00:00
, " Statistics "
2013-10-28 04:19:27 +00:00
# endif
2013-11-29 10:36:47 +00:00
} ;
2013-10-20 15:33:18 +00:00
graphicsSettings - > Add ( new PopupMultiChoice ( & g_Config . iShowFPSCounter , gs - > T ( " Show FPS Counter " ) , fpsChoices , 0 , ARRAY_SIZE ( fpsChoices ) , gs , screenManager ( ) ) ) ;
2013-11-02 20:33:27 +00:00
graphicsSettings - > Add ( new CheckBox ( & showDebugStats_ , gs - > T ( " Show Debug Statistics " ) ) ) ;
2013-10-20 15:33:18 +00:00
2013-09-30 17:13:47 +00:00
// Developer tools are not accessible ingame, so it goes here.
2013-08-18 17:51:40 +00:00
graphicsSettings - > Add ( new ItemHeader ( gs - > T ( " Debugging " ) ) ) ;
2013-08-18 21:11:47 +00:00
Choice * dump = graphicsSettings - > Add ( new Choice ( gs - > T ( " Dump next frame to log " ) ) ) ;
dump - > OnClick . Handle ( this , & GameSettingsScreen : : OnDumpNextFrameToLog ) ;
if ( ! PSP_IsInited ( ) )
dump - > SetEnabled ( false ) ;
2013-08-18 17:51:40 +00:00
2013-09-30 17:13:47 +00:00
// We normally use software rendering to debug so put it in debugging.
CheckBox * softwareGPU = graphicsSettings - > Add ( new CheckBox ( & g_Config . bSoftwareRendering , gs - > T ( " Software Rendering " , " Software Rendering (experimental) " ) ) ) ;
if ( PSP_IsInited ( ) )
softwareGPU - > SetEnabled ( false ) ;
2013-07-20 14:03:52 +00:00
// Audio
2013-06-08 20:42:31 +00:00
ViewGroup * audioSettingsScroll = new ScrollView ( ORIENT_VERTICAL , new LinearLayoutParams ( FILL_PARENT , FILL_PARENT ) ) ;
2013-08-19 22:49:25 +00:00
LinearLayout * audioSettings = new LinearLayout ( ORIENT_VERTICAL ) ;
audioSettings - > SetSpacing ( 0 ) ;
2013-06-08 20:42:31 +00:00
audioSettingsScroll - > Add ( audioSettings ) ;
2013-08-11 15:25:50 +00:00
tabHolder - > AddTab ( ms - > T ( " Audio " ) , audioSettingsScroll ) ;
2013-08-09 10:57:03 +00:00
2013-08-20 10:28:17 +00:00
audioSettings - > Add ( new ItemHeader ( ms - > T ( " Audio " ) ) ) ;
2013-08-09 10:57:03 +00:00
2013-10-27 02:35:51 +00:00
audioSettings - > Add ( new PopupSliderChoice ( & g_Config . iSFXVolume , 0 , MAX_CONFIG_VOLUME , a - > T ( " SFX volume " ) , screenManager ( ) ) ) ;
audioSettings - > Add ( new PopupSliderChoice ( & g_Config . iBGMVolume , 0 , MAX_CONFIG_VOLUME , a - > T ( " BGM volume " ) , screenManager ( ) ) ) ;
2013-10-10 14:44:12 +00:00
2013-08-16 17:34:44 +00:00
audioSettings - > Add ( new CheckBox ( & g_Config . bEnableSound , a - > T ( " Enable Sound " ) ) ) ;
2013-08-30 06:10:05 +00:00
audioSettings - > Add ( new CheckBox ( & g_Config . bLowLatencyAudio , a - > T ( " Low latency audio " ) ) ) ;
2013-08-16 17:34:44 +00:00
2013-07-20 14:03:52 +00:00
// Control
2013-06-09 10:41:12 +00:00
ViewGroup * controlsSettingsScroll = new ScrollView ( ORIENT_VERTICAL , new LinearLayoutParams ( FILL_PARENT , FILL_PARENT ) ) ;
2013-08-19 22:49:25 +00:00
LinearLayout * controlsSettings = new LinearLayout ( ORIENT_VERTICAL ) ;
controlsSettings - > SetSpacing ( 0 ) ;
2013-06-09 10:41:12 +00:00
controlsSettingsScroll - > Add ( controlsSettings ) ;
2013-08-11 15:25:50 +00:00
tabHolder - > AddTab ( ms - > T ( " Controls " ) , controlsSettingsScroll ) ;
2013-08-20 10:28:17 +00:00
controlsSettings - > Add ( new ItemHeader ( ms - > T ( " Controls " ) ) ) ;
2013-08-21 14:12:49 +00:00
controlsSettings - > Add ( new Choice ( c - > T ( " Control Mapping " ) ) ) - > OnClick . Handle ( this , & GameSettingsScreen : : OnControlMapping ) ;
2013-10-09 20:15:56 +00:00
2013-10-28 17:28:08 +00:00
# if defined(USING_GLES2)
2013-10-10 14:44:12 +00:00
controlsSettings - > Add ( new CheckBox ( & g_Config . bHapticFeedback , c - > T ( " HapticFeedback " , " Haptic Feedback (vibration) " ) ) ) ;
2013-08-20 10:28:17 +00:00
controlsSettings - > Add ( new CheckBox ( & g_Config . bAccelerometerToAnalogHoriz , c - > T ( " Tilt " , " Tilt to Analog (horizontal) " ) ) ) ;
2013-10-27 17:58:47 +00:00
Choice * tiltAnalog = controlsSettings - > Add ( new Choice ( c - > T ( " Customize tilt " ) ) ) ;
tiltAnalog - > OnClick . Handle ( this , & GameSettingsScreen : : OnTiltAnalogSettings ) ;
2013-10-29 09:21:47 +00:00
tiltAnalog - > SetEnabledPtr ( & g_Config . bAccelerometerToAnalogHoriz ) ;
2013-09-29 19:47:15 +00:00
# endif
2013-08-20 10:28:17 +00:00
controlsSettings - > Add ( new ItemHeader ( c - > T ( " OnScreen " , " On-Screen Touch Controls " ) ) ) ;
2013-10-29 09:21:47 +00:00
controlsSettings - > Add ( new CheckBox ( & g_Config . bShowTouchControls , c - > T ( " OnScreen " , " On-Screen Touch Controls " ) ) ) ;
2013-10-20 15:40:18 +00:00
layoutEditorChoice_ = controlsSettings - > Add ( new Choice ( c - > T ( " Custom layout... " ) ) ) ;
layoutEditorChoice_ - > OnClick . Handle ( this , & GameSettingsScreen : : OnTouchControlLayout ) ;
2013-10-29 09:21:47 +00:00
layoutEditorChoice_ - > SetEnabledPtr ( & g_Config . bShowTouchControls ) ;
2013-12-02 14:50:09 +00:00
CheckBox * disableDiags = controlsSettings - > Add ( new CheckBox ( & g_Config . bDisableDpadDiagonals , c - > T ( " Disable D-Pad diagonals (4-way touch) " ) ) ) ;
disableDiags - > SetEnabledPtr ( & g_Config . bShowTouchControls ) ;
2013-12-11 19:01:17 +00:00
View * opacity = controlsSettings - > Add ( new PopupSliderChoice ( & g_Config . iTouchButtonOpacity , 0 , 100 , c - > T ( " Button Opacity " ) , screenManager ( ) ) ) ;
opacity - > SetEnabledPtr ( & g_Config . bShowTouchControls ) ;
2013-12-10 22:19:37 +00:00
static const char * touchControlStyles [ ] = { " Classic " , " Thin borders " } ;
View * style = controlsSettings - > Add ( new PopupMultiChoice ( & g_Config . iTouchButtonStyle , c - > T ( " Button style " ) , touchControlStyles , 0 , ARRAY_SIZE ( touchControlStyles ) , c , screenManager ( ) ) ) ;
2013-12-11 19:01:17 +00:00
style - > SetEnabledPtr ( & g_Config . bShowTouchControls ) ;
2013-10-10 14:44:12 +00:00
2013-07-20 14:03:52 +00:00
// System
2013-06-09 10:41:12 +00:00
ViewGroup * systemSettingsScroll = new ScrollView ( ORIENT_VERTICAL , new LinearLayoutParams ( FILL_PARENT , FILL_PARENT ) ) ;
2013-08-19 22:49:25 +00:00
LinearLayout * systemSettings = new LinearLayout ( ORIENT_VERTICAL ) ;
systemSettings - > SetSpacing ( 0 ) ;
2013-06-09 10:41:12 +00:00
systemSettingsScroll - > Add ( systemSettings ) ;
2013-08-11 15:25:50 +00:00
tabHolder - > AddTab ( ms - > T ( " System " ) , systemSettingsScroll ) ;
2013-08-17 21:49:06 +00:00
2013-10-20 15:33:18 +00:00
systemSettings - > Add ( new ItemHeader ( s - > T ( " UI Language " ) ) ) ;
systemSettings - > Add ( new Choice ( dev - > T ( " Language " , " Language " ) ) ) - > OnClick . Handle ( this , & GameSettingsScreen : : OnLanguage ) ;
2013-08-18 17:51:40 +00:00
systemSettings - > Add ( new ItemHeader ( s - > T ( " Emulation " ) ) ) ;
systemSettings - > Add ( new CheckBox ( & g_Config . bFastMemory , s - > T ( " Fast Memory " , " Fast Memory (Unstable) " ) ) ) ;
2013-08-21 07:20:43 +00:00
systemSettings - > Add ( new CheckBox ( & g_Config . bSeparateCPUThread , s - > T ( " Multithreaded (experimental) " ) ) ) - > SetEnabled ( ! PSP_IsInited ( ) ) ;
systemSettings - > Add ( new CheckBox ( & g_Config . bSeparateIOThread , s - > T ( " I/O on thread (experimental) " ) ) ) - > SetEnabled ( ! PSP_IsInited ( ) ) ;
2013-12-10 22:19:37 +00:00
systemSettings - > Add ( new PopupSliderChoice ( & g_Config . iLockedCPUSpeed , 0 , 1000 , s - > T ( " Change CPU Clock " , " Change CPU Clock (0 = default) (unstable) " ) , screenManager ( ) ) ) ;
2013-12-05 15:15:33 +00:00
# ifndef USING_GLES2
2013-11-03 15:56:17 +00:00
systemSettings - > Add ( new PopupSliderChoice ( & g_Config . iRewindFlipFrequency , 0 , 1800 , s - > T ( " Rewind Snapshot Frequency " , " Rewind Snapshot Frequency (0 = off, mem hog) " ) , screenManager ( ) ) ) ;
2013-12-05 15:15:33 +00:00
# endif
2013-08-18 17:51:40 +00:00
2013-10-15 06:06:37 +00:00
systemSettings - > Add ( new CheckBox ( & g_Config . bAtomicAudioLocks , s - > T ( " Atomic Audio locks (experimental) " ) ) ) - > SetEnabled ( ! PSP_IsInited ( ) ) ;
2013-12-10 22:19:37 +00:00
systemSettings - > Add ( new ItemHeader ( s - > T ( " Developer Tools " ) ) ) ;
systemSettings - > Add ( new Choice ( s - > T ( " Developer Tools " ) ) ) - > OnClick . Handle ( this , & GameSettingsScreen : : OnDeveloperTools ) ;
2013-10-20 15:33:18 +00:00
2013-09-28 06:21:59 +00:00
systemSettings - > Add ( new ItemHeader ( s - > T ( " General " ) ) ) ;
2013-12-12 14:58:46 +00:00
systemSettings - > Add ( new CheckBox ( & g_Config . bCheckForNewVersion , s - > T ( " VersionCheck " , " Check for new versions of PPSSPP " ) ) ) ;
2013-08-27 22:07:41 +00:00
systemSettings - > Add ( new Choice ( s - > T ( " Clear Recent Games List " ) ) ) - > OnClick . Handle ( this , & GameSettingsScreen : : OnClearRecents ) ;
2013-09-28 06:21:59 +00:00
systemSettings - > Add ( new Choice ( s - > T ( " Restore Default Settings " ) ) ) - > OnClick . Handle ( this , & GameSettingsScreen : : OnRestoreDefaultSettings ) ;
2013-11-01 23:11:20 +00:00
systemSettings - > Add ( new CheckBox ( & g_Config . bEnableAutoLoad , s - > T ( " Auto Load Newest Savestate " ) ) ) ;
2013-12-04 10:46:42 +00:00
enableReports_ = Reporting : : IsEnabled ( ) ;
2013-09-01 20:08:47 +00:00
enableReportsCheckbox_ = new CheckBox ( & enableReports_ , s - > T ( " Enable Compatibility Server Reports " ) ) ;
enableReportsCheckbox_ - > SetEnabled ( Reporting : : IsSupported ( ) ) ;
systemSettings - > Add ( enableReportsCheckbox_ ) ;
2013-08-20 16:03:52 +00:00
2013-12-10 22:19:37 +00:00
systemSettings - > Add ( new ItemHeader ( s - > T ( " Networking " ) ) ) ;
systemSettings - > Add ( new CheckBox ( & g_Config . bEnableWlan , s - > T ( " Enable networking " , " Enable networking/wlan (beta) " ) ) ) ;
//#ifndef ANDROID
systemSettings - > Add ( new ItemHeader ( s - > T ( " Cheats " , " Cheats (experimental, see forums) " ) ) ) ;
systemSettings - > Add ( new CheckBox ( & g_Config . bEnableCheats , s - > T ( " Enable Cheats " ) ) ) ;
//#endif
LinearLayout * list = root_ - > Add ( new LinearLayout ( ORIENT_VERTICAL , new LinearLayoutParams ( 1.0f ) ) ) ;
systemSettings - > SetSpacing ( 0 ) ;
2013-08-20 16:03:52 +00:00
2013-08-18 17:51:40 +00:00
systemSettings - > Add ( new ItemHeader ( s - > T ( " PSP Settings " ) ) ) ;
2013-09-28 06:21:59 +00:00
// TODO: Come up with a way to display a keyboard for mobile users,
// so until then, this is Windows/Desktop only.
2013-12-08 10:16:18 +00:00
# if defined(_WIN32) || defined(USING_QT_UI)
2013-09-28 06:21:59 +00:00
systemSettings - > Add ( new Choice ( s - > T ( " Change Nickname " ) ) ) - > OnClick . Handle ( this , & GameSettingsScreen : : OnChangeNickname ) ;
2013-12-08 10:16:18 +00:00
# endif
# if defined(_WIN32) || (defined(USING_QT_UI) && !defined(USING_GLES2))
// Screenshot functionality is not yet available on non-Windows/non-Qt
2013-09-28 06:21:59 +00:00
systemSettings - > Add ( new CheckBox ( & g_Config . bScreenshotsAsPNG , s - > T ( " Screenshots as PNG " ) ) ) ;
2013-11-29 15:46:47 +00:00
# endif
2013-07-21 21:06:04 +00:00
systemSettings - > Add ( new CheckBox ( & g_Config . bDayLightSavings , s - > T ( " Day Light Saving " ) ) ) ;
2013-07-21 20:15:18 +00:00
static const char * dateFormat [ ] = { " YYYYMMDD " , " MMDDYYYY " , " DDMMYYYY " } ;
2013-08-21 14:12:49 +00:00
systemSettings - > Add ( new PopupMultiChoice ( & g_Config . iDateFormat , s - > T ( " Date Format " ) , dateFormat , 1 , 3 , s , screenManager ( ) ) ) ;
2013-07-21 20:15:18 +00:00
static const char * timeFormat [ ] = { " 12HR " , " 24HR " } ;
2013-08-21 14:12:49 +00:00
systemSettings - > Add ( new PopupMultiChoice ( & g_Config . iTimeFormat , s - > T ( " Time Format " ) , timeFormat , 1 , 2 , s , screenManager ( ) ) ) ;
2013-08-21 09:17:55 +00:00
static const char * buttonPref [ ] = { " Use O to confirm " , " Use X to confirm " } ;
2013-08-21 14:12:49 +00:00
systemSettings - > Add ( new PopupMultiChoice ( & g_Config . iButtonPreference , s - > T ( " Confirmation Button " ) , buttonPref , 0 , 2 , s , screenManager ( ) ) ) ;
2013-06-08 20:42:31 +00:00
}
2013-10-29 15:22:36 +00:00
UI : : EventReturn GameSettingsScreen : : OnRenderingMode ( UI : : EventParams & e ) {
2013-10-30 10:28:14 +00:00
// We do not want to report when rendering mode is Framebuffer to memory - so many issues
// are caused by that (framebuffer copies overwriting display lists, etc).
2013-10-29 15:22:36 +00:00
enableReports_ = Reporting : : IsEnabled ( ) ;
enableReportsCheckbox_ - > SetEnabled ( Reporting : : IsSupported ( ) ) ;
2013-10-30 10:28:14 +00:00
postProcChoice_ - > SetEnabled ( g_Config . iRenderingMode ! = 0 ) ;
2013-10-30 11:12:14 +00:00
resolutionChoice_ - > SetEnabled ( g_Config . iRenderingMode ! = 0 ) ;
2013-10-29 15:22:36 +00:00
return UI : : EVENT_DONE ;
}
2013-08-25 19:36:34 +00:00
UI : : EventReturn GameSettingsScreen : : OnClearRecents ( UI : : EventParams & e ) {
g_Config . recentIsos . clear ( ) ;
2013-09-07 16:44:28 +00:00
OnRecentChanged . Trigger ( e ) ;
2013-08-25 19:36:34 +00:00
return UI : : EVENT_DONE ;
}
2013-08-18 17:57:50 +00:00
UI : : EventReturn GameSettingsScreen : : OnReloadCheats ( UI : : EventParams & e ) {
// Hmm, strange mechanism.
g_Config . bReloadCheats = true ;
return UI : : EVENT_DONE ;
}
2013-10-13 17:24:49 +00:00
UI : : EventReturn GameSettingsScreen : : OnFullscreenChange ( UI : : EventParams & e ) {
host - > GoFullscreen ( g_Config . bFullScreen ) ;
return UI : : EVENT_DONE ;
}
2013-09-10 22:19:34 +00:00
UI : : EventReturn GameSettingsScreen : : OnResolutionChange ( UI : : EventParams & e ) {
2013-09-11 05:13:06 +00:00
if ( gpu ) {
gpu - > Resized ( ) ;
}
2013-09-10 22:19:34 +00:00
return UI : : EVENT_DONE ;
}
2013-10-22 11:00:19 +00:00
UI : : EventReturn GameSettingsScreen : : OnShaderChange ( UI : : EventParams & e ) {
if ( gpu ) {
2013-10-22 12:34:16 +00:00
gpu - > ClearShaderCache ( ) ;
2013-10-22 11:00:19 +00:00
}
return UI : : EVENT_DONE ;
}
2013-07-30 14:28:34 +00:00
void DrawBackground ( float alpha ) ;
2013-08-18 17:51:40 +00:00
UI : : EventReturn GameSettingsScreen : : OnDumpNextFrameToLog ( UI : : EventParams & e ) {
2013-08-18 21:11:47 +00:00
if ( gpu ) {
gpu - > DumpNextFrame ( ) ;
}
2013-08-18 17:51:40 +00:00
return UI : : EVENT_DONE ;
}
2013-07-30 14:28:34 +00:00
void GameSettingsScreen : : DrawBackground ( UIContext & dc ) {
GameInfo * ginfo = g_gameInfoCache . GetInfo ( gamePath_ , true ) ;
dc . Flush ( ) ;
dc . RebindTexture ( ) ;
: : DrawBackground ( 1.0f ) ;
dc . Flush ( ) ;
if ( ginfo & & ginfo - > pic1Texture ) {
ginfo - > pic1Texture - > Bind ( 0 ) ;
uint32_t color = whiteAlpha ( ease ( ( time_now_d ( ) - ginfo - > timePic1WasLoaded ) * 3 ) ) & 0xFFc0c0c0 ;
dc . Draw ( ) - > DrawTexRect ( 0 , 0 , dp_xres , dp_yres , 0 , 0 , 1 , 1 , color ) ;
dc . Flush ( ) ;
dc . RebindTexture ( ) ;
}
/*
if ( ginfo & & ginfo - > pic0Texture ) {
ginfo - > pic0Texture - > Bind ( 0 ) ;
// Pic0 is drawn in the bottom right corner, overlaying pic1.
float sizeX = dp_xres / 480 * ginfo - > pic0Texture - > Width ( ) ;
float sizeY = dp_yres / 272 * ginfo - > pic0Texture - > Height ( ) ;
uint32_t color = whiteAlpha ( ease ( ( time_now_d ( ) - ginfo - > timePic1WasLoaded ) * 2 ) ) & 0xFFc0c0c0 ;
ui_draw2d . DrawTexRect ( dp_xres - sizeX , dp_yres - sizeY , dp_xres , dp_yres , 0 , 0 , 1 , 1 , color ) ;
ui_draw2d . Flush ( ) ;
dc . RebindTexture ( ) ;
} */
}
2013-08-10 09:34:27 +00:00
2013-07-21 11:31:46 +00:00
void GameSettingsScreen : : update ( InputState & input ) {
UIScreen : : update ( input ) ;
2013-07-17 23:04:11 +00:00
g_Config . iForceMaxEmulatedFPS = cap60FPS_ ? 60 : 0 ;
2013-08-18 16:53:45 +00:00
g_Config . iFpsLimit = alternateSpeedTable [ iAlternateSpeedPercent_ ] ;
2013-11-02 20:33:27 +00:00
if ( g_Config . bShowDebugStats ! = showDebugStats_ ) {
// This affects the jit.
if ( MIPSComp : : jit ) {
MIPSComp : : jit - > ClearCache ( ) ;
}
g_Config . bShowDebugStats = showDebugStats_ ;
}
2013-07-17 20:27:05 +00:00
}
2013-09-04 02:06:05 +00:00
void GameSettingsScreen : : sendMessage ( const char * message , const char * value ) {
2013-10-21 20:52:44 +00:00
// Always call the base class method first to handle the most common messages.
UIDialogScreenWithBackground : : sendMessage ( message , value ) ;
2013-09-24 05:03:59 +00:00
if ( ! strcmp ( message , " control mapping " ) ) {
UpdateUIState ( UISTATE_MENU ) ;
screenManager ( ) - > push ( new ControlMappingScreen ( ) ) ;
}
2013-09-04 02:06:05 +00:00
}
2013-10-25 11:19:08 +00:00
void GameSettingsScreen : : onFinish ( DialogResult result ) {
2013-10-17 14:15:04 +00:00
if ( g_Config . bEnableSound ) {
if ( PSP_IsInited ( ) & & ! IsAudioInitialised ( ) )
2013-08-14 12:55:31 +00:00
Audio_Init ( ) ;
2013-08-14 12:44:36 +00:00
}
2013-10-17 14:15:04 +00:00
2013-09-01 19:57:39 +00:00
Reporting : : Enable ( enableReports_ , " report.ppsspp.org " ) ;
2013-08-20 16:03:52 +00:00
g_Config . Save ( ) ;
2013-09-04 15:21:33 +00:00
host - > UpdateUI ( ) ;
2013-09-08 04:42:15 +00:00
2013-08-22 11:10:06 +00:00
KeyMap : : UpdateConfirmCancelKeys ( ) ;
2013-10-25 11:19:08 +00:00
}
2013-08-20 16:03:52 +00:00
/*
2013-07-17 20:27:05 +00:00
void GlobalSettingsScreen : : CreateViews ( ) {
using namespace UI ;
root_ = new ScrollView ( ORIENT_VERTICAL ) ;
2013-09-01 19:57:39 +00:00
enableReports_ = Reporting : : IsEnabled ( ) ;
2013-08-20 16:03:52 +00:00
} */
2013-07-18 09:39:54 +00:00
2013-08-20 16:03:52 +00:00
UI : : EventReturn GameSettingsScreen : : OnChangeNickname ( UI : : EventParams & e ) {
2013-12-08 10:16:18 +00:00
# if defined(_WIN32) || defined(USING_QT_UI)
2013-08-18 00:03:59 +00:00
const size_t name_len = 256 ;
char name [ name_len ] ;
memset ( name , 0 , sizeof ( name ) ) ;
2013-12-08 10:16:18 +00:00
if ( System_InputBoxGetString ( " Enter a new PSP nickname " , g_Config . sNickName . c_str ( ) , name , name_len ) ) {
2013-08-18 00:03:59 +00:00
g_Config . sNickName = name ;
}
2013-12-07 18:57:06 +00:00
# endif
2013-08-21 08:52:40 +00:00
2013-08-18 00:03:59 +00:00
return UI : : EVENT_DONE ;
}
2013-08-20 16:03:52 +00:00
UI : : EventReturn GameSettingsScreen : : OnLanguage ( UI : : EventParams & e ) {
2013-09-03 08:42:26 +00:00
I18NCategory * de = GetI18NCategory ( " Developer " ) ;
auto langScreen = new NewLanguageScreen ( de - > T ( " Language " ) ) ;
2013-09-01 20:29:23 +00:00
langScreen - > OnChoice . Handle ( this , & GameSettingsScreen : : OnLanguageChange ) ;
screenManager ( ) - > push ( langScreen ) ;
return UI : : EVENT_DONE ;
}
UI : : EventReturn GameSettingsScreen : : OnLanguageChange ( UI : : EventParams & e ) {
RecreateViews ( ) ;
2013-11-03 00:24:19 +00:00
2013-09-07 16:48:12 +00:00
if ( host ) {
host - > UpdateUI ( ) ;
}
2013-07-17 20:27:05 +00:00
return UI : : EVENT_DONE ;
}
2013-10-12 00:05:55 +00:00
UI : : EventReturn GameSettingsScreen : : OnPostProcShader ( UI : : EventParams & e ) {
I18NCategory * g = GetI18NCategory ( " Graphics " ) ;
auto procScreen = new PostProcScreen ( g - > T ( " Postprocessing Shader " ) ) ;
procScreen - > OnChoice . Handle ( this , & GameSettingsScreen : : OnPostProcShaderChange ) ;
screenManager ( ) - > push ( procScreen ) ;
return UI : : EVENT_DONE ;
}
UI : : EventReturn GameSettingsScreen : : OnPostProcShaderChange ( UI : : EventParams & e ) {
if ( gpu ) {
gpu - > Resized ( ) ;
}
return UI : : EVENT_DONE ;
}
2013-08-20 16:03:52 +00:00
UI : : EventReturn GameSettingsScreen : : OnDeveloperTools ( UI : : EventParams & e ) {
2013-07-18 09:39:54 +00:00
screenManager ( ) - > push ( new DeveloperToolsScreen ( ) ) ;
return UI : : EVENT_DONE ;
}
2013-07-29 00:15:30 +00:00
UI : : EventReturn GameSettingsScreen : : OnControlMapping ( UI : : EventParams & e ) {
2013-08-17 08:34:38 +00:00
screenManager ( ) - > push ( new ControlMappingScreen ( ) ) ;
2013-07-22 22:06:07 +00:00
return UI : : EVENT_DONE ;
}
2013-10-20 02:45:58 +00:00
UI : : EventReturn GameSettingsScreen : : OnTouchControlLayout ( UI : : EventParams & e ) {
2013-10-09 20:15:56 +00:00
screenManager ( ) - > push ( new TouchControlLayoutScreen ( ) ) ;
return UI : : EVENT_DONE ;
} ;
2013-10-27 17:58:47 +00:00
UI : : EventReturn GameSettingsScreen : : OnTiltAnalogSettings ( UI : : EventParams & e ) {
screenManager ( ) - > push ( new TiltAnalogSettingsScreen ( ) ) ;
return UI : : EVENT_DONE ;
} ;
2013-07-18 09:39:54 +00:00
void DeveloperToolsScreen : : CreateViews ( ) {
using namespace UI ;
root_ = new ScrollView ( ORIENT_VERTICAL ) ;
2013-09-03 08:42:26 +00:00
I18NCategory * d = GetI18NCategory ( " Dialog " ) ;
I18NCategory * de = GetI18NCategory ( " Developer " ) ;
2013-08-17 11:21:17 +00:00
I18NCategory * gs = GetI18NCategory ( " Graphics " ) ;
2013-07-20 10:06:06 +00:00
I18NCategory * a = GetI18NCategory ( " Audio " ) ;
2013-08-30 15:57:33 +00:00
I18NCategory * s = GetI18NCategory ( " System " ) ;
2013-07-18 09:39:54 +00:00
LinearLayout * list = root_ - > Add ( new LinearLayout ( ORIENT_VERTICAL , new LinearLayoutParams ( 1.0f ) ) ) ;
2013-08-19 22:49:25 +00:00
list - > SetSpacing ( 0 ) ;
2013-08-30 15:10:14 +00:00
list - > Add ( new ItemHeader ( s - > T ( " General " ) ) ) ;
2013-10-20 15:33:18 +00:00
# ifdef IOS
2013-12-01 19:28:20 +00:00
if ( ! iosCanUseJit ) {
2013-10-20 15:33:18 +00:00
list - > Add ( new TextView ( s - > T ( " DynarecisJailed " , " Dynarec (JIT) - (Not jailbroken - JIT not available) " ) ) ) ;
} else {
list - > Add ( new CheckBox ( & g_Config . bJit , s - > T ( " Dynarec " , " Dynarec (JIT) " ) ) ) ;
}
# else
list - > Add ( new CheckBox ( & g_Config . bJit , s - > T ( " Dynarec " , " Dynarec (JIT) " ) ) ) ;
# endif
2013-09-03 08:42:26 +00:00
list - > Add ( new Choice ( de - > T ( " System Information " ) ) ) - > OnClick . Handle ( this , & DeveloperToolsScreen : : OnSysInfo ) ;
2013-09-07 18:54:11 +00:00
list - > Add ( new CheckBox ( & g_Config . bShowDeveloperMenu , de - > T ( " Show Developer Menu " ) ) ) ;
2013-10-12 19:34:13 +00:00
Choice * cpuTests = new Choice ( de - > T ( " Run CPU Tests " ) ) ;
list - > Add ( cpuTests ) - > OnClick . Handle ( this , & DeveloperToolsScreen : : OnRunCPUTests ) ;
2013-10-14 07:53:13 +00:00
# ifdef IOS
const std : : string testDirectory = g_Config . flash0Directory + " ../ " ;
# else
const std : : string testDirectory = g_Config . memCardDirectory ;
# endif
if ( ! File : : Exists ( testDirectory + " pspautotests/tests/ " ) ) {
2013-10-12 19:34:13 +00:00
cpuTests - > SetEnabled ( false ) ;
2013-10-14 07:53:13 +00:00
}
2013-10-12 19:34:13 +00:00
2013-10-13 18:14:28 +00:00
list - > Add ( new CheckBox ( & g_Config . bEnableLogging , de - > T ( " Enable Logging " ) ) ) - > OnClick . Handle ( this , & DeveloperToolsScreen : : OnLoggingChanged ) ;
2013-09-28 06:21:59 +00:00
list - > Add ( new Choice ( de - > T ( " Logging Channels " ) ) ) - > OnClick . Handle ( this , & DeveloperToolsScreen : : OnLogConfig ) ;
2013-09-03 08:42:26 +00:00
list - > Add ( new ItemHeader ( de - > T ( " Language " ) ) ) ;
list - > Add ( new Choice ( de - > T ( " Load language ini " ) ) ) - > OnClick . Handle ( this , & DeveloperToolsScreen : : OnLoadLanguageIni ) ;
list - > Add ( new Choice ( de - > T ( " Save language ini " ) ) ) - > OnClick . Handle ( this , & DeveloperToolsScreen : : OnSaveLanguageIni ) ;
2013-10-28 15:04:53 +00:00
list - > Add ( new ItemHeader ( " " ) ) ;
2013-10-25 11:19:08 +00:00
list - > Add ( new Choice ( d - > T ( " Back " ) ) ) - > OnClick . Handle < UIScreen > ( this , & UIScreen : : OnBack ) ;
2013-07-18 09:39:54 +00:00
}
2013-10-25 11:19:08 +00:00
void DeveloperToolsScreen : : onFinish ( DialogResult result ) {
2013-08-04 08:45:09 +00:00
g_Config . Save ( ) ;
2013-07-18 09:39:54 +00:00
}
2013-09-28 06:21:59 +00:00
void GameSettingsScreen : : CallbackRestoreDefaults ( bool yes ) {
2013-10-25 11:19:08 +00:00
if ( yes )
2013-08-28 20:23:16 +00:00
g_Config . RestoreDefaults ( ) ;
2013-09-29 02:41:47 +00:00
host - > UpdateUI ( ) ;
2013-08-28 20:23:16 +00:00
}
2013-09-28 06:21:59 +00:00
UI : : EventReturn GameSettingsScreen : : OnRestoreDefaultSettings ( UI : : EventParams & e ) {
2013-09-03 08:42:26 +00:00
I18NCategory * de = GetI18NCategory ( " Developer " ) ;
2013-08-28 20:23:16 +00:00
I18NCategory * d = GetI18NCategory ( " Dialog " ) ;
screenManager ( ) - > push (
2013-09-07 11:38:37 +00:00
new PromptScreen ( de - > T ( " RestoreDefaultSettings " , " Are you sure you want to restore all settings(except control mapping) \n back to their defaults? \n You can't undo this. \n Please restart PPSSPP after restoring settings. " ) , d - > T ( " OK " ) , d - > T ( " Cancel " ) ,
2013-09-28 06:21:59 +00:00
std : : bind ( & GameSettingsScreen : : CallbackRestoreDefaults , this , placeholder : : _1 ) ) ) ;
2013-08-28 20:23:16 +00:00
return UI : : EVENT_DONE ;
}
2013-08-17 23:24:34 +00:00
UI : : EventReturn DeveloperToolsScreen : : OnLoggingChanged ( UI : : EventParams & e ) {
2013-10-13 18:25:59 +00:00
host - > ToggleDebugConsoleVisibility ( ) ;
2013-08-17 23:24:34 +00:00
return UI : : EVENT_DONE ;
}
2013-08-17 22:41:19 +00:00
UI : : EventReturn DeveloperToolsScreen : : OnSysInfo ( UI : : EventParams & e ) {
screenManager ( ) - > push ( new SystemInfoScreen ( ) ) ;
return UI : : EVENT_DONE ;
}
2013-07-18 09:39:54 +00:00
UI : : EventReturn DeveloperToolsScreen : : OnRunCPUTests ( UI : : EventParams & e ) {
RunTests ( ) ;
return UI : : EVENT_DONE ;
}
2013-07-20 10:06:06 +00:00
2013-08-18 17:51:40 +00:00
UI : : EventReturn DeveloperToolsScreen : : OnSaveLanguageIni ( UI : : EventParams & e ) {
2013-09-16 23:47:25 +00:00
i18nrepo . SaveIni ( g_Config . sLanguageIni ) ;
2013-08-18 17:51:40 +00:00
return UI : : EVENT_DONE ;
}
UI : : EventReturn DeveloperToolsScreen : : OnLoadLanguageIni ( UI : : EventParams & e ) {
2013-09-16 23:47:25 +00:00
i18nrepo . LoadIni ( g_Config . sLanguageIni ) ;
2013-07-20 10:06:06 +00:00
return UI : : EVENT_DONE ;
}
2013-09-07 11:38:37 +00:00
UI : : EventReturn DeveloperToolsScreen : : OnLogConfig ( UI : : EventParams & e ) {
screenManager ( ) - > push ( new LogConfigScreen ( ) ) ;
return UI : : EVENT_DONE ;
}