From e00364bfa5d7740b1f458a0bc427e3153b8e9e17 Mon Sep 17 00:00:00 2001 From: The Dax Date: Thu, 25 Jul 2013 18:34:55 -0400 Subject: [PATCH 1/5] Add initial support for native Visual Studio 2012(and above) compilation. Just upgrade the SLN, and go. --- Common/stdafx.h | 11 +++++++++-- GPU/GLES/TextureScaler.cpp | 3 +++ Windows/stdafx.h | 8 +++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Common/stdafx.h b/Common/stdafx.h index 993286e03b..3481699e0a 100644 --- a/Common/stdafx.h +++ b/Common/stdafx.h @@ -18,8 +18,15 @@ #pragma once #ifndef _WIN32_WINNT - #define _WIN32_WINNT 0x501 -#endif + +#if _MSC_VER < 1700 +#define _WIN32_WINNT 0x501 // Compile for XP on Visual Studio 2010 and below +#else +#define _WIN32_WINNT 0x600 // Compile for Vista on Visual Studio 2012 and above +#endif // #if _MSC_VER < 1700 + +#endif // #ifndef _WIN32_WINNT + #ifndef _WIN32_IE #define _WIN32_IE 0x0500 // Default value is 0x0400 #endif diff --git a/GPU/GLES/TextureScaler.cpp b/GPU/GLES/TextureScaler.cpp index b592c2cdb2..c13bbdbfec 100644 --- a/GPU/GLES/TextureScaler.cpp +++ b/GPU/GLES/TextureScaler.cpp @@ -15,6 +15,9 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. +// Has to be included before TextureScaler.h, else we get those std::bind errors in VS2012.. +#include "../native/base/basictypes.h" + #include "TextureScaler.h" #include "Core/Config.h" diff --git a/Windows/stdafx.h b/Windows/stdafx.h index a7b53365b7..30f5a12f98 100644 --- a/Windows/stdafx.h +++ b/Windows/stdafx.h @@ -26,7 +26,13 @@ //#ifdef WINDOWS #undef _WIN32_WINNT -#define _WIN32_WINNT 0x600 + +#if _MSC_VER < 1700 +#define _WIN32_WINNT 0x501 // Compile for XP on Visual Studio 2010 and below +#else +#define _WIN32_WINNT 0x600 // Compile for Vista on Visual Studio 2012 and above +#endif + #undef WINVER #define WINVER 0x0600 #ifndef _WIN32_IE From 8da6259affa27cd5011a1b030b559b0cd3b74dc0 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 25 Jul 2013 22:25:50 -0700 Subject: [PATCH 2/5] More carefully check defines for endianness. --- Common/CommonTypes.h | 46 +++++++++++++++++++++--- Core/FileSystems/DirectoryFileSystem.cpp | 2 +- Core/Font/PGF.h | 7 +--- Core/HLE/sceKernelThread.cpp | 3 +- native | 2 +- 5 files changed, 47 insertions(+), 13 deletions(-) diff --git a/Common/CommonTypes.h b/Common/CommonTypes.h index 55e5458bdf..1323fdb838 100644 --- a/Common/CommonTypes.h +++ b/Common/CommonTypes.h @@ -54,13 +54,51 @@ typedef signed long long s64; #endif // _WIN32 +// Android +#if defined(ANDROID) +#include -#ifdef ANDROID -#undef BIG_ENDIAN -#undef __BIG_ENDIAN__ +#if _BYTE_ORDER == _LITTLE_ENDIAN && !defined(COMMON_LITTLE_ENDIAN) +#define COMMON_LITTLE_ENDIAN 1 +#elif _BYTE_ORDER == _BIG_ENDIAN && !defined(COMMON_BIG_ENDIAN) +#define COMMON_BIG_ENDIAN 1 #endif -#if !BIG_ENDIAN && !__BIG_ENDIAN__ +// GCC 4.6+ +#elif __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) + +#if __BYTE_ORDER__ && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) && !defined(COMMON_LITTLE_ENDIAN) +#define COMMON_LITTLE_ENDIAN 1 +#elif __BYTE_ORDER__ && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) && !defined(COMMON_BIG_ENDIAN) +#define COMMON_BIG_ENDIAN 1 +#endif + +// LLVM/clang +#elif __clang__ + +#if __LITTLE_ENDIAN__ && !defined(COMMON_LITTLE_ENDIAN) +#define COMMON_LITTLE_ENDIAN 1 +#elif __BIG_ENDIAN__ && !defined(COMMON_BIG_ENDIAN) +#define COMMON_BIG_ENDIAN 1 +#endif + +// MSVC +#elif defined(_MSC_VER) && !defined(COMMON_BIG_ENDIAN) && !defined(COMMON_LITTLE_ENDIAN) + +#ifdef _XBOX +#define COMMON_BIG_ENDIAN 1 +#else +#define COMMON_LITTLE_ENDIAN 1 +#endif + +#endif + +// Worst case, default to little endian. +#if !COMMON_BIG_ENDIAN && !COMMON_LITTLE_ENDIAN +#define COMMON_LITTLE_ENDIAN 1 +#endif + +#if COMMON_LITTLE_ENDIAN typedef u32 u32_le; typedef u16 u16_le; typedef u64 u64_le; diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index 5c63da888a..38eae20467 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -702,7 +702,7 @@ VirtualDiscFileSystem::VirtualDiscFileSystem(IHandleAllocator *_hAlloc, std::str VirtualDiscFileSystem::~VirtualDiscFileSystem() { for (auto iter = entries.begin(); iter != entries.end(); ++iter) { - if (!iter->second.type != VFILETYPE_ISO) + if (iter->second.type != VFILETYPE_ISO) iter->second.hFile.Close(); } } diff --git a/Core/Font/PGF.h b/Core/Font/PGF.h index 8815f49097..b9c18972ef 100644 --- a/Core/Font/PGF.h +++ b/Core/Font/PGF.h @@ -109,12 +109,7 @@ struct Glyph { }; -#ifdef ANDROID -#undef BIG_ENDIAN -#undef __BIG_ENDIAN__ -#endif - -#if !BIG_ENDIAN && !__BIG_ENDIAN__ +#if COMMON_LITTLE_ENDIAN typedef FontPixelFormat FontPixelFormat_le; #else #error FIX ME diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index c531898099..43927638cd 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -21,6 +21,7 @@ #include #include "Common/LogManager.h" +#include "Common/CommonTypes.h" #include "HLE.h" #include "HLETables.h" #include "../MIPS/MIPSInt.h" @@ -149,7 +150,7 @@ public: u32 savedIdRegister; }; -#if !defined(BIG_ENDIAN) && !defined(__BIG_ENDIAN__) +#if COMMON_LITTLE_ENDIAN typedef WaitType WaitType_le; #else #error FIX ME diff --git a/native b/native index 4871c1192d..230d061fb2 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 4871c1192d54adb9be8f642d4c0303cf359104db +Subproject commit 230d061fb2c19dd0aedc91c8529db0a1ad94980f From a740888adde5e1b6f977793c2f54c1010b2fc6aa Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 25 Jul 2013 22:37:27 -0700 Subject: [PATCH 3/5] Fix typos. --- Core/HLE/__sceAudio.cpp | 2 +- native | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/HLE/__sceAudio.cpp b/Core/HLE/__sceAudio.cpp index 5367754db8..cd68ea42e0 100644 --- a/Core/HLE/__sceAudio.cpp +++ b/Core/HLE/__sceAudio.cpp @@ -46,7 +46,7 @@ const int hostAttemptBlockSize = 256; #else const int hwBlockSize = 64; const int hostAttemptBlockSize = 512; -#endif; +#endif const int audioIntervalUs = (int)(1000000ULL * hwBlockSize / hwSampleRate); const int audioHostIntervalUs = (int)(1000000ULL * hostAttemptBlockSize / hwSampleRate); diff --git a/native b/native index 230d061fb2..f72b981395 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 230d061fb2c19dd0aedc91c8529db0a1ad94980f +Subproject commit f72b981395c31b566270d7c3125c981e3263adb7 From 87f13d9b32f7861a5187d514c8af8d81747884e6 Mon Sep 17 00:00:00 2001 From: Kingcom Date: Fri, 26 Jul 2013 14:42:38 +0200 Subject: [PATCH 4/5] Fix auto boot --- UI/NativeApp.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 59fa02dc50..c4948b8c7a 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -299,8 +299,9 @@ void NativeInit(int argc, const char *argv[], } else { if (boot_filename.empty()) { boot_filename = argv[i]; - if (!File::Exists(boot_filename)) - { + + FileInfo info; + if (!getFileInfo(boot_filename.c_str(), &info) || info.exists == false) { fprintf(stderr, "File not found: %s\n", boot_filename.c_str()); exit(1); } @@ -376,14 +377,10 @@ void NativeInit(int argc, const char *argv[], if (Atrac3plus_Decoder::CanAutoInstall()) { Atrac3plus_Decoder::DoAutoInstall(); } - screenManager->switchScreen(new LogoScreen(boot_filename)); -#else - screenManager->switchScreen(new LogoScreen(boot_filename)); #endif - } else { - // Go directly into the game. - screenManager->switchScreen(new EmuScreen(boot_filename)); } + + screenManager->switchScreen(new LogoScreen(boot_filename)); } void NativeInitGraphics() { From d8365272542de140b8f9284a62091166a1477b47 Mon Sep 17 00:00:00 2001 From: raven02 Date: Fri, 26 Jul 2013 20:25:11 +0800 Subject: [PATCH 5/5] NewUI fix and add selectable frameskipping/Resolution to winUI --- GPU/GLES/Framebuffer.h | 4 + UI/GameSettingsScreen.cpp | 23 +++--- Windows/WndMainWindow.cpp | 158 ++++++++++++++++++++++++++++++++++---- Windows/ppsspp.rc | Bin 38620 -> 39214 bytes Windows/resource.h | Bin 25650 -> 26754 bytes 5 files changed, 158 insertions(+), 27 deletions(-) diff --git a/GPU/GLES/Framebuffer.h b/GPU/GLES/Framebuffer.h index 2b6909c7da..d11bd84718 100644 --- a/GPU/GLES/Framebuffer.h +++ b/GPU/GLES/Framebuffer.h @@ -58,8 +58,12 @@ enum { enum { FB_NON_BUFFERED_MODE = 0, FB_BUFFERED_MODE = 1, +#ifndef USING_GLES2 FB_READFBOMEMORY_CPU = 2, FB_READFBOMEMORY_GPU = 3, +#else + FB_READFBOMEMORY_GPU = 2, +#endif }; struct VirtualFramebuffer { diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 183c9e7647..ac6ec918ee 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -193,13 +193,13 @@ void GameSettingsScreen::CreateViews() { tabHolder->AddTab("Graphics", graphicsSettingsScroll); graphicsSettings->Add(new ItemHeader(gs->T("Rendering Mode"))); - static const char *renderingMode[] = { "Non-Buffered Rendering", "Buffered Rendering", #ifndef USING_GLES2 - "Read Framebuffers To Memory(CPU)", -#endif - "Read Framebuffers To Memory(GPU)" - }; + static const char *renderingMode[] = { "Non-Buffered Rendering", "Buffered Rendering", "Read Framebuffers To Memory(CPU)", "Read Framebuffers To Memory(GPU)"}; graphicsSettings->Add(new PopupMultiChoice(&g_Config.iRenderingMode, gs->T("Mode"), renderingMode, 0, 4, gs, screenManager())); +#else + static const char *renderingMode[] = { "Non-Buffered Rendering", "Buffered Rendering", "Read Framebuffers To Memory(GPU)"}; + graphicsSettings->Add(new PopupMultiChoice(&g_Config.iRenderingMode, gs->T("Mode"), renderingMode, 0, 3, gs, screenManager())); +#endif graphicsSettings->Add(new ItemHeader(gs->T("Features"))); graphicsSettings->Add(new CheckBox(&g_Config.bHardwareTransform, gs->T("Hardware Transform"))); graphicsSettings->Add(new CheckBox(&g_Config.bVertexCache, gs->T("Vertex Cache"))); @@ -220,17 +220,18 @@ void GameSettingsScreen::CreateViews() { static const char *anisoLevels[] = { "Off", "2x", "4x", "8x", "16x" }; graphicsSettings->Add(new PopupMultiChoice(&g_Config.iAnisotropyLevel, gs->T("Anisotropic Filtering"), anisoLevels, 0, 5, gs, screenManager())); graphicsSettings->Add(new ItemHeader(gs->T("Texture Scaling"))); - static const char *texScaleLevels[] = { - "Off (1x)", "2x", "3x", #ifndef USING_GLES2 - "4x", "5x", -#endif - }; + static const char *texScaleLevels[] = {"Off", "2x", "3x","4x", "5x"}; graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexScalingLevel, gs->T("Upscale Level"), texScaleLevels, 1, 5, gs, screenManager())); +#else + static const char *texScaleLevels[] = {"Off", "2x", "3x"}; + graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexScalingLevel, gs->T("Upscale Level"), texScaleLevels, 1, 3, gs, screenManager())); +#endif static const char *texScaleAlgos[] = { "xBRZ", "Hybrid", "Bicubic", "Hybrid + Bicubic", }; graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexScalingType, gs->T("Upscale Type"), texScaleAlgos, 0, 4, gs, screenManager())); + graphicsSettings->Add(new CheckBox(&g_Config.bTexDeposterize, gs->T("Deposterize"))); graphicsSettings->Add(new ItemHeader(gs->T("Texture Filtering"))); - static const char *texFilters[] = { "Default (auto)", "Nearest", "Linear", "Linear on FMV", }; + static const char *texFilters[] = { "Auto", "Nearest", "Linear", "Linear on FMV", }; graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexFiltering, gs->T("Upscale Type"), texFilters, 1, 4, gs, screenManager())); // Audio diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index e3dca9d15b..a6aa1d02f1 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -180,7 +180,7 @@ namespace MainWindow gpu->Resized(); } - void SetZoom(float zoom) { + void setZoom(float zoom) { if (zoom < 5) g_Config.iWindowZoom = (int) zoom; RECT rc, rcOuter; @@ -204,22 +204,22 @@ namespace MainWindow } } - void setTexScalingLevel(int num) { - g_Config.iTexScalingLevel = num; + void setTexScalingLevel(int level) { + g_Config.iTexScalingLevel = level; if(gpu) gpu->ClearCacheNextFrame(); } - void setTexFiltering(int num) { - g_Config.iTexFiltering = num; + void setTexFiltering(int type) { + g_Config.iTexFiltering = type; } - void setTexScalingType(int num) { - g_Config.iTexScalingType = num; + void setTexScalingType(int type) { + g_Config.iTexScalingType = type; if(gpu) gpu->ClearCacheNextFrame(); } - void setRenderingMode(int num) { - g_Config.iRenderingMode = num; + void setRenderingMode(int mode) { + g_Config.iRenderingMode = mode; if (gpu) gpu->Resized(); } @@ -227,6 +227,10 @@ namespace MainWindow g_Config.iFpsLimit = fps; } + void setFrameSkipping(int frame) { + g_Config.iFrameSkip = frame; + } + void enableCheats(bool cheats){ g_Config.bEnableCheats = cheats; } @@ -695,18 +699,39 @@ namespace MainWindow break; case ID_OPTIONS_SCREEN1X: - SetZoom(1); + setZoom(1); break; case ID_OPTIONS_SCREEN2X: - SetZoom(2); + setZoom(2); break; case ID_OPTIONS_SCREEN3X: - SetZoom(3); + setZoom(3); break; case ID_OPTIONS_SCREEN4X: - SetZoom(4); + setZoom(4); break; + case ID_OPTIONS_SCREENDUMMY: + g_Config.iWindowZoom = ++g_Config.iWindowZoom > 4 ? 1 : g_Config.iWindowZoom; + + switch(g_Config.iWindowZoom) { + case 1: + osm.Show(g->T("1x Rending Resolution")); + break; + case 2: + osm.Show(g->T("2x Rending Resolution")); + break; + case 3: + osm.Show(g->T("3x Rending Resolution")); + break; + case 4: + osm.Show(g->T("4x Rending Resolution")); + break; + } + + setZoom(g_Config.iWindowZoom); + + break; case ID_OPTIONS_MIPMAP: g_Config.bMipMap = !g_Config.bMipMap; break; @@ -803,9 +828,84 @@ namespace MainWindow gpu->Resized(); // easy way to force a clear... break; - case ID_OPTIONS_FRAMESKIP: - g_Config.iFrameSkip = g_Config.iFrameSkip == 0 ? 1 : 0; - osm.ShowOnOff(g->T("Frame Skipping"), g_Config.iFrameSkip != 0); + case ID_OPTIONS_FRAMESKIP_0: + setFrameSkipping(0); + break; + + case ID_OPTIONS_FRAMESKIP_1: + setFrameSkipping(1); + break; + + case ID_OPTIONS_FRAMESKIP_2: + setFrameSkipping(2); + break; + + case ID_OPTIONS_FRAMESKIP_3: + setFrameSkipping(3); + break; + + case ID_OPTIONS_FRAMESKIP_4: + setFrameSkipping(4); + break; + + case ID_OPTIONS_FRAMESKIP_5: + setFrameSkipping(5); + break; + + case ID_OPTIONS_FRAMESKIP_6: + setFrameSkipping(6); + break; + + case ID_OPTIONS_FRAMESKIP_7: + setFrameSkipping(7); + break; + + case ID_OPTIONS_FRAMESKIP_8: + setFrameSkipping(8); + break; + + case ID_OPTIONS_FRAMESKIP_9: + setFrameSkipping(9); + break; + + case ID_OPTIONS_FRAMESKIPDUMMY: + g_Config.iFrameSkip = ++g_Config.iFrameSkip > 9 ? 0 : g_Config.iFrameSkip; + + switch(g_Config.iFrameSkip) { + case 0: + osm.Show(g->T("No Frame Skip")); + break; + case 1: + osm.Show(g->T("Skip 1 frame")); + break; + case 2: + osm.Show(g->T("Skip 2 frames")); + break; + case 3: + osm.Show(g->T("Skip 3 frames")); + break; + case 4: + osm.Show(g->T("Skip 4 frames")); + break; + case 5: + osm.Show(g->T("Skip 5 frames")); + break; + case 6: + osm.Show(g->T("Skip 6 frames")); + break; + case 7: + osm.Show(g->T("Skip 7 frames")); + break; + case 8: + osm.Show(g->T("Skip 8 frames")); + break; + case 9: + osm.Show(g->T("Skip 9 frames")); + break; + } + + setFrameSkipping(g_Config.iFrameSkip); + break; case ID_FILE_EXIT: @@ -1154,6 +1254,32 @@ namespace MainWindow CheckMenuItem(menu, renderingmode[i], MF_BYCOMMAND | ( i == g_Config.iRenderingMode )? MF_CHECKED : MF_UNCHECKED); } + static const int frameskipping[] = { + ID_OPTIONS_FRAMESKIP_0, + ID_OPTIONS_FRAMESKIP_1, + ID_OPTIONS_FRAMESKIP_2, + ID_OPTIONS_FRAMESKIP_3, + ID_OPTIONS_FRAMESKIP_4, + ID_OPTIONS_FRAMESKIP_5, + ID_OPTIONS_FRAMESKIP_6, + ID_OPTIONS_FRAMESKIP_7, + ID_OPTIONS_FRAMESKIP_8, + ID_OPTIONS_FRAMESKIP_9, + }; + for (int i = 0; i < 9; i++) { + CheckMenuItem(menu, frameskipping[i], MF_BYCOMMAND | ( i == g_Config.iFrameSkip )? MF_CHECKED : MF_UNCHECKED); + } + + static const int zoommode[] = { + ID_OPTIONS_SCREEN1X, + ID_OPTIONS_SCREEN2X, + ID_OPTIONS_SCREEN3X, + ID_OPTIONS_SCREEN4X, + }; + for (int i = 0; i < 4; i++) { + CheckMenuItem(menu, zoommode[i], MF_BYCOMMAND | ( i == g_Config.iWindowZoom )? MF_CHECKED : MF_UNCHECKED); + } + UpdateCommands(); } diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 14fd10df38c89aa348fe289abcbda66a42e73823..4eebf6a5f15a43e7131f010d2f771f0afcfbb5f9 100644 GIT binary patch delta 661 zcmajb&nts*90&0CMr_7-rjY!2A|XGr*`A@u@03QdDN!@cugCU0V|yZpNlwZ^z3&ck zWXW@vgMYw5~VCmO#Sl{ z{^wpwfAa5+`(!uchKHTo?tB-AbdR~JpW3-;xOtgwD3;MCCW`3+j_%howd7!rT9Kct zAc`I~?ls!Hlve70s8^`ZqCTO$7VQ=4x2Ruez@h=6ibWNnL5l{3_F1$~X#Y=@qUc8% zO5lVO6PUrc88u=K^KD15F{e3PF(e^l0i&4ZtI@$!TH#e@x6Frq$e71GMlkZ-sAh)Q hU`+BOw#>S02_LfStj(VDePe*}!#Z2UJUU#e{sM{N#s>fZ delta 512 zcmZwCJxCh?7{>AEVuoNNcgB#UCBo^T5i_JQloCp*EtI0*2UZs~sNo7p?#|2gBoStTzQJxke4896-qx6oALV)iJp`Ha;_yh|kR1D)a`VnWb+RG)e zlal(SjY+!9c3U&zG6}8SPReBtwSLA*679thCvt!4OI{ikFU|Z4o7&s%$G2o;v5qWM zD9%g$m&Zx}ND4!<_znd!=I{}dkP(A|G7Km%k%I;WIxH+hx=^)7 zATdUx$s6tEkyILkL?>SoQa}}=T8U3~FkoReVlbTC$OE@a)P*6G!I#08A(DZUfs?_6!GHmz Z0^&!Z$p+3`lBg=+Y8Z?*$0uB71^|6