Skip to content

Commit

Permalink
Merge pull request #1 from hrydgard/master
Browse files Browse the repository at this point in the history
Merge from head
  • Loading branch information
CrazyMax committed Mar 31, 2013
2 parents 341ff96 + 3bd5146 commit 716664c
Show file tree
Hide file tree
Showing 49 changed files with 971 additions and 353 deletions.
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1013,22 +1013,26 @@ endif()
# installs
file(INSTALL ${NativeAssets} DESTINATION assets)

# packaging and code signing
if (IOS)
# Fix CMake some Xcode settings.
if(APPLE)
# Fix CMake breaking optimization settings.
set(CMAKE_CXX_FLAGS_DEBUG "-g -D_DEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -D_NDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -D_NDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -D_NDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -D_NDEBUG")
set(CMAKE_C_FLAGS_DEBUG "-g -D_DEBUG")
set(CMAKE_C_FLAGS_MINSIZEREL "-Os -D_NDEBUG")
set(CMAKE_C_FLAGS_RELEASE "-O2 -D_NDEBUG")
set(CMAKE_C_FLAGS_RELEASE "-O3 -D_NDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -D_NDEBUG")

# These can be fast.
# These can be fast even for debug.
set_target_properties(cityhash PROPERTIES COMPILE_FLAGS "-O3")
set_target_properties(snappy PROPERTIES COMPILE_FLAGS "-O3")
set_target_properties(zlib PROPERTIES COMPILE_FLAGS "-O3")
endif()

# packaging and code signing
if(IOS)
add_dependencies(PPSSPP ${CoreLibName} GPU Common native)

file(GLOB IOSAssets ios/assets/*.png)
Expand Down
2 changes: 2 additions & 0 deletions Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ void Config::Load(const char *iniFileName)
general->Get("Recent", recentIsos);
general->Get("WindowX", &iWindowX, 40);
general->Get("WindowY", &iWindowY, 100);
general->Get("AutoSaveSymbolMap", &bAutoSaveSymbolMap, false);

if (recentIsos.size() > MAX_RECENT)
recentIsos.resize(MAX_RECENT);
Expand Down Expand Up @@ -139,6 +140,7 @@ void Config::Save()
general->Set("Recent", recentIsos);
general->Set("WindowX", iWindowX);
general->Set("WindowY", iWindowY);
general->Set("AutoSaveSymbolMap", bAutoSaveSymbolMap);

IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU");
cpu->Set("Jit", bJit);
Expand Down
1 change: 1 addition & 0 deletions Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ struct Config
bool bIgnoreBadMemAccess;
bool bFastMemory;
bool bJit;
bool bAutoSaveSymbolMap;
std::string sReportHost;
std::vector<std::string> recentIsos;

Expand Down
15 changes: 10 additions & 5 deletions Core/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ void Core_WaitInactive()

void Core_WaitInactive(int milliseconds)
{
while (!Core_IsInactive())
m_hInactiveEvent.wait_for(m_hInactiveMutex, milliseconds);
m_hInactiveEvent.wait_for(m_hInactiveMutex, milliseconds);
}

void UpdateScreenScale() {
Expand All @@ -104,17 +103,23 @@ void Core_RunLoop()
UpdateScreenScale();
{
{
lock_guard guard(input_state.lock);
#ifdef _WIN32
lock_guard guard(input_state.lock);
input_state.pad_buttons = 0;
input_state.pad_lstick_x = 0;
input_state.pad_lstick_y = 0;
input_state.pad_rstick_x = 0;
input_state.pad_rstick_y = 0;
// Temporary hack.
if (GetAsyncKeyState(VK_ESCAPE)) {
input_state.pad_buttons |= PAD_BUTTON_MENU;
} else {
input_state.pad_buttons &= ~PAD_BUTTON_MENU;
}
host->PollControllers(input_state);
UpdateInputState(&input_state);
#endif
}
NativeUpdate(input_state);
EndInputState(&input_state);
}
NativeRender();
// Simple throttling to not burn the GPU in the menu.
Expand Down
4 changes: 2 additions & 2 deletions Core/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#pragma once

#include "Globals.h"
#include "Core/Core.h"
#include "Core/System.h"
#include "Core/CoreParameter.h"

// called from emu thread
Expand All @@ -37,4 +37,4 @@ bool Core_IsInactive();
void Core_WaitInactive();
void Core_WaitInactive(int milliseconds);

void UpdateScreenScale();
void UpdateScreenScale();
5 changes: 4 additions & 1 deletion Core/CoreParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ enum GPUCore {

struct CoreParameter
{
CoreParameter() : collectEmuLog(0) {}
CoreParameter() : collectEmuLog(0), unthrottle(false) {}
// 0 = Interpreter
// 1 = Jit
// 2 = JitIL
Expand Down Expand Up @@ -63,4 +63,7 @@ struct CoreParameter
// Actual pixel output resolution (for use by glViewport and the like)
int pixelWidth;
int pixelHeight;

// Can be modified at runtime.
bool unthrottle;
};
3 changes: 3 additions & 0 deletions Core/Dialog/PSPDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class PointerWrap;
#define SCE_UTILITY_DIALOG_RESULT_CANCEL 1
#define SCE_UTILITY_DIALOG_RESULT_ABORT 2

const int SCE_ERROR_UTILITY_INVALID_STATUS = 0x80110001;
const int SCE_ERROR_UTILITY_WRONG_TYPE = 0x80110005;

typedef struct
{
unsigned int size; /** Size of the structure */
Expand Down
6 changes: 6 additions & 0 deletions Core/Dialog/PSPMsgDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ int PSPMsgDialog::Update()
return 0;
}

int PSPMsgDialog::Abort()
{
// TODO: Probably not exactly the same?
return PSPDialog::Shutdown();
}

int PSPMsgDialog::Shutdown()
{
return PSPDialog::Shutdown();
Expand Down
1 change: 1 addition & 0 deletions Core/Dialog/PSPMsgDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class PSPMsgDialog: public PSPDialog {
virtual int Update();
virtual int Shutdown();
virtual void DoState(PointerWrap &p);
int Abort();

private :
void DisplayBack();
Expand Down
2 changes: 1 addition & 1 deletion Core/Dialog/PSPOskDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ int PSPOskDialog::Init(u32 oskPtr)
// Ignore if already running
if (status != SCE_UTILITY_STATUS_NONE && status != SCE_UTILITY_STATUS_SHUTDOWN)
{
return -1;
return SCE_ERROR_UTILITY_INVALID_STATUS;
}
status = SCE_UTILITY_STATUS_INITIALIZE;

Expand Down
7 changes: 5 additions & 2 deletions Core/Dialog/PSPSaveDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int PSPSaveDialog::Init(int paramAddr)
if (status != SCE_UTILITY_STATUS_NONE && status != SCE_UTILITY_STATUS_SHUTDOWN)
{
ERROR_LOG(HLE,"A save request is already running !");
return 0;
return SCE_ERROR_UTILITY_INVALID_STATUS;
}

int size = Memory::Read_U32(paramAddr);
Expand Down Expand Up @@ -379,7 +379,7 @@ int PSPSaveDialog::Update()

if (status != SCE_UTILITY_STATUS_RUNNING)
{
return 0;
return SCE_ERROR_UTILITY_INVALID_STATUS;
}

if (!param.GetPspParam()) {
Expand Down Expand Up @@ -798,6 +798,9 @@ int PSPSaveDialog::Update()

int PSPSaveDialog::Shutdown()
{
if (status != SCE_UTILITY_STATUS_FINISHED)
return SCE_ERROR_UTILITY_INVALID_STATUS;

PSPDialog::Shutdown();
param.SetPspParam(0);

Expand Down
10 changes: 2 additions & 8 deletions Core/HLE/sceDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,8 @@ void DebugStats()

// Let's collect all the throttling and frameskipping logic here.
void DoFrameTiming(bool &throttle, bool &skipFrame) {
#ifdef _WIN32
throttle = !GetAsyncKeyState(VK_TAB);
#else
throttle = true;
#endif
throttle = !PSP_CoreParameter().unthrottle;

skipFrame = false;
if (PSP_CoreParameter().headLess)
throttle = false;
Expand Down Expand Up @@ -444,9 +441,6 @@ void hleEnterVblank(u64 userdata, int cyclesLate) {

void hleAfterFlip(u64 userdata, int cyclesLate)
{
// This checks input on PC. Fine to do even if not calling BeginFrame.
host->BeginFrame();

gpu->BeginFrame(); // doesn't really matter if begin or end of frame.
}

Expand Down
4 changes: 4 additions & 0 deletions Core/HLE/sceKernelModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro
dontadd = true;
}
}
else if (host->AttemptLoadSymbolMap())
{
dontadd = true;
}

INFO_LOG(LOADER,"Module %s: %08x %08x %08x", modinfo->name, modinfo->gp, modinfo->libent,modinfo->libstub);

Expand Down
Loading

0 comments on commit 716664c

Please sign in to comment.