diff --git a/Core/CoreParameter.h b/Core/CoreParameter.h index 1cd6e08f3f..5b9124860f 100644 --- a/Core/CoreParameter.h +++ b/Core/CoreParameter.h @@ -33,7 +33,7 @@ enum GPUCore { struct CoreParameter { - CoreParameter() : collectEmuLog(0) {} + CoreParameter() : collectEmuLog(0), unthrottle(false) {} // 0 = Interpreter // 1 = Jit // 2 = JitIL @@ -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; }; diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index df367a9021..177532a328 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -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; diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 500b211aed..1a5368c2f1 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -207,7 +207,13 @@ void EmuScreen::update(InputState &input) { __CtrlSetAnalog(stick_x, stick_y); - if (input.pad_buttons_down & (PAD_BUTTON_MENU | PAD_BUTTON_BACK)) { + if (input.pad_buttons & PAD_BUTTON_LEFT_THUMB) { + PSP_CoreParameter().unthrottle = true; + } else { + PSP_CoreParameter().unthrottle = false; + } + + if (input.pad_buttons_down & (PAD_BUTTON_MENU | PAD_BUTTON_BACK | PAD_BUTTON_RIGHT_THUMB)) { if (g_Config.bBufferedRendering) fbo_unbind(); screenManager()->push(new PauseScreen()); diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index a7fab39c4e..91b6193592 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -303,7 +303,6 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co void NativeInitGraphics() { - INFO_LOG(BOOT, "NativeInitGraphics - should only be called once!"); gl_lost_manager_init(); ui_draw2d.SetAtlas(&ui_atlas); diff --git a/Windows/KeyboardDevice.cpp b/Windows/KeyboardDevice.cpp index 1a6dbabc14..5df18f6204 100644 --- a/Windows/KeyboardDevice.cpp +++ b/Windows/KeyboardDevice.cpp @@ -4,22 +4,8 @@ #include "../Core/HLE/sceCtrl.h" #include "WinUser.h" -static const unsigned short key_ctrl_map[] = { - VK_SPACE, CTRL_START, - 'V', CTRL_SELECT, - 'A', CTRL_SQUARE, - 'S', CTRL_TRIANGLE, - 'X', CTRL_CIRCLE, - 'Z', CTRL_CROSS, - 'Q', CTRL_LTRIGGER, - 'W', CTRL_RTRIGGER, - VK_UP, CTRL_UP, - VK_DOWN, CTRL_DOWN, - VK_LEFT, CTRL_LEFT, - VK_RIGHT, CTRL_RIGHT, -}; - -static const unsigned short key_pad_map[] = { +static const unsigned int key_pad_map[] = { + VK_TAB, PAD_BUTTON_LEFT_THUMB, VK_SPACE, PAD_BUTTON_START, 'V', PAD_BUTTON_SELECT, 'A', PAD_BUTTON_X, @@ -46,7 +32,7 @@ int KeyboardDevice::UpdateState(InputState &input_state) { static u32 alternator = 0; bool doAlternate = alternate && (alternator++ % 10) < 5; - for (int i = 0; i < sizeof(key_ctrl_map)/sizeof(key_ctrl_map[0]); i += 2) { + for (int i = 0; i < sizeof(key_pad_map)/sizeof(key_pad_map[0]); i += 2) { if (GetAsyncKeyState(key_pad_map[i]) && !doAlternate) { input_state.pad_buttons |= key_pad_map[i+1]; } diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 6ce7777e04..908a14d4fe 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -132,8 +132,7 @@ void WindowsHost::SetDebugMode(bool mode) void WindowsHost::PollControllers(InputState &input_state) { for (auto iter = this->input.begin(); iter != this->input.end(); iter++) - if ((*iter)->UpdateState(input_state) == 0) - break; // *iter is std::shared_ptr, **iter is InputDevice + (*iter)->UpdateState(input_state); } void WindowsHost::BootDone() diff --git a/Windows/XinputDevice.cpp b/Windows/XinputDevice.cpp index b65e1fd0f9..a9d104f6cc 100644 --- a/Windows/XinputDevice.cpp +++ b/Windows/XinputDevice.cpp @@ -85,7 +85,9 @@ static Stick NormalizedDeadzoneFilter(short x, short y) { return left; } -static const unsigned short xinput_ctrl_map[] = { +// Yes, this maps more than the PSP has, but that's fine as this lets us +// map buttons to extra functionality like speedup. +static const unsigned int xinput_ctrl_map[] = { XINPUT_GAMEPAD_DPAD_UP, PAD_BUTTON_UP, XINPUT_GAMEPAD_DPAD_DOWN, PAD_BUTTON_DOWN, XINPUT_GAMEPAD_DPAD_LEFT, PAD_BUTTON_LEFT, @@ -98,7 +100,10 @@ static const unsigned short xinput_ctrl_map[] = { XINPUT_GAMEPAD_B, PAD_BUTTON_B, XINPUT_GAMEPAD_X, PAD_BUTTON_X, XINPUT_GAMEPAD_Y, PAD_BUTTON_Y, + XINPUT_GAMEPAD_LEFT_THUMB, PAD_BUTTON_LEFT_THUMB, + XINPUT_GAMEPAD_RIGHT_THUMB, PAD_BUTTON_RIGHT_THUMB, }; + static inline u32 CtrlForXinput(int xinput) { for (int i = 0; i < sizeof(xinput_ctrl_map)/sizeof(xinput_ctrl_map[0]); i += 2) if (xinput_ctrl_map[i] == xinput) return (u32) xinput_ctrl_map[i+1]; @@ -106,11 +111,8 @@ static inline u32 CtrlForXinput(int xinput) { } void XinputDevice::ApplyDiff(XINPUT_STATE &state, InputState &input_state) { - unsigned short pressed = state.Gamepad.wButtons & ~this->prevState.Gamepad.wButtons; - unsigned short released = ~state.Gamepad.wButtons & this->prevState.Gamepad.wButtons; - for (int i = 1; i < USHRT_MAX; i <<= 1) { - if (pressed & i) + if (state.Gamepad.wButtons & i) input_state.pad_buttons |= CtrlForXinput(i); } } \ No newline at end of file diff --git a/android/jni/TestRunner.cpp b/android/jni/TestRunner.cpp index 7e0c6de730..dd65b0af83 100644 --- a/android/jni/TestRunner.cpp +++ b/android/jni/TestRunner.cpp @@ -70,6 +70,7 @@ void RunTests() coreParam.pixelHeight = 272; coreParam.useMediaEngine = false; coreParam.collectEmuLog = &output; + coreParam.unthrottle = true; #ifdef IOS std::string baseDirectory = g_Config.flashDirectory + "../"; diff --git a/android/src/org/ppsspp/ppsspp/PpssppActivity.java b/android/src/org/ppsspp/ppsspp/PpssppActivity.java index bd47aac307..005b5075a7 100644 --- a/android/src/org/ppsspp/ppsspp/PpssppActivity.java +++ b/android/src/org/ppsspp/ppsspp/PpssppActivity.java @@ -16,4 +16,4 @@ public class PpssppActivity extends NativeActivity { return false; } } - \ No newline at end of file + \ No newline at end of file diff --git a/native b/native index 22e648bb1a..79e14282ec 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 22e648bb1a5e8fe6e427efc906194edbb9ce6ed8 +Subproject commit 79e14282ecf006caef6fe12d19358952741ad7fc