Merge remote-tracking branch 'origin'

This commit is contained in:
Henrik Rydgard 2013-07-27 00:45:54 +02:00
commit 5dbf5da355
14 changed files with 229 additions and 51 deletions

View File

@ -54,13 +54,51 @@ typedef signed long long s64;
#endif // _WIN32
// Android
#if defined(ANDROID)
#include <sys/endian.h>
#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;

View File

@ -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

View File

@ -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();
}
}

View File

@ -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

View File

@ -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);

View File

@ -21,6 +21,7 @@
#include <algorithm>
#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

View File

@ -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 {

View File

@ -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"

View File

@ -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

View File

@ -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() {

View File

@ -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();
}

Binary file not shown.

Binary file not shown.

View File

@ -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