From 9614fef4b9d027e1be9dbb766ed98ee5cb09df39 Mon Sep 17 00:00:00 2001 From: Zion Date: Fri, 26 Jan 2018 10:18:09 -0800 Subject: [PATCH 01/54] Use clang 5.0 in travis (#4115) * Use clang 5.0 in travis * Change clang-5.0 to just clang --- .travis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f214250f13..ff2a37de08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,9 +26,6 @@ git: submodules: false before_install: - - if [ "$CC" = "clang" ]; then - export CXX="clang++-4.0" CC="clang-4.0"; - fi; - if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5" CXXFLAGS="-Wno-format-security"; fi; @@ -65,7 +62,7 @@ before_script: - cmake .. -DCMAKE_INSTALL_PREFIX=/usr -G Ninja; - ninja - # AppImage generation - - if [ -n "$UPLOAD_URL" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$CC" = "clang-4.0" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then + - if [ -n "$UPLOAD_URL" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$CC" = "clang" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then export LD_LIBRARY_PATH=~/Qt/5.10.0/gcc_64/lib; DESTDIR=appdir ninja install ; find appdir/ ; find ../bin ; @@ -111,7 +108,8 @@ addons: - libc6-dev - llvm-4.0 - llvm-4.0-dev - - clang-4.0 + # Clang 5.0 is now bundled in travis, so we no longer need the ppa version. + #- clang-4.0 - libedit-dev - g++-5 - gcc-5 From bb5bdb2e8c27fc766fc557a66a94c3fec8511add Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sun, 31 Dec 2017 12:01:11 +0100 Subject: [PATCH 02/54] improve cellKB keyreleases and autorepeat --- rpcs3/Emu/Cell/Modules/cellKb.cpp | 10 +++++----- rpcs3/Emu/Io/KeyboardHandler.h | 23 +++++++++++++---------- rpcs3/basic_keyboard_handler.cpp | 10 ++++++++++ 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellKb.cpp b/rpcs3/Emu/Cell/Modules/cellKb.cpp index 7bf6a67b14..0c80f816ad 100644 --- a/rpcs3/Emu/Cell/Modules/cellKb.cpp +++ b/rpcs3/Emu/Cell/Modules/cellKb.cpp @@ -100,7 +100,7 @@ u16 cellKbCnvRawCode(u32 arrange, u32 mkey, u32 led, u16 rawcode) ((led&(CELL_KB_LED_CAPS_LOCK)) ? 0 : 0x20) : ((led&(CELL_KB_LED_CAPS_LOCK)) ? 0x20 : 0); return rawcode + 0x5D; - } + } if (rawcode >= 0x1E && rawcode <= 0x26) return rawcode + 0x13; // '1' - '9' if (rawcode == 0x27) return 0x30; // '0' if (rawcode == 0x28) return 0x0A; // '\n' @@ -136,7 +136,7 @@ error_code cellKbGetInfo(vm::ptr info) { info->status[i] = current_info.status[i]; } - + return CELL_OK; } @@ -165,7 +165,7 @@ error_code cellKbRead(u32 port_no, vm::ptr data) } current_data.len = 0; - + return CELL_OK; } @@ -180,7 +180,7 @@ error_code cellKbSetCodeType(u32 port_no, u32 type) if (port_no >= handler->GetKeyboards().size()) return CELL_KB_ERROR_INVALID_PARAMETER; - + KbConfig& current_config = handler->GetConfig(port_no); current_config.code_type = type; return CELL_OK; @@ -203,7 +203,7 @@ error_code cellKbSetReadMode(u32 port_no, u32 rmode) if (port_no >= handler->GetKeyboards().size()) return CELL_KB_ERROR_INVALID_PARAMETER; - + KbConfig& current_config = handler->GetConfig(port_no); current_config.read_mode = rmode; diff --git a/rpcs3/Emu/Io/KeyboardHandler.h b/rpcs3/Emu/Io/KeyboardHandler.h index 11e2a80c07..d8528982c1 100644 --- a/rpcs3/Emu/Io/KeyboardHandler.h +++ b/rpcs3/Emu/Io/KeyboardHandler.h @@ -248,6 +248,7 @@ struct KbButton struct Keyboard { + bool m_key_repeat; // for future use KbData m_data; KbConfig m_config; std::vector m_buttons; @@ -255,6 +256,7 @@ struct Keyboard Keyboard() : m_data() , m_config() + , m_key_repeat(false) { } }; @@ -274,19 +276,20 @@ public: { for(Keyboard& keyboard : m_keyboards) { + KbData& data = keyboard.m_data; + KbConfig& config = keyboard.m_config; + + // TODO: handle read modes + for(KbButton& button : keyboard.m_buttons) { if(button.m_keyCode != code) continue; - KbData& data = keyboard.m_data; - KbConfig& config = keyboard.m_config; - if (pressed) { // Meta Keys - if (code == 308 || code == 307 || code == 306 || - code == 393 || code == 396 || code == 394) + if (code == 308 || code == 307 || code == 306 || code == 393 || code == 396 || code == 394) { data.mkey |= button.m_outKeyCode; } @@ -310,17 +313,17 @@ public: data.len++; } } - - if (!pressed) + else { // Meta Keys - if (code == 308 || code == 307 || code == 306 || - code == 393 || code == 396 || code == 394) + if (code == 308 || code == 307 || code == 306 || code == 393 || code == 396 || code == 394) { data.mkey &= ~button.m_outKeyCode; } + // Needed to indicate key releases. Without this you have to tap another key before using the same key again + data.keycode[0] = CELL_KEYC_NO_EVENT; + data.len = 1; } - } } } diff --git a/rpcs3/basic_keyboard_handler.cpp b/rpcs3/basic_keyboard_handler.cpp index aeee594934..5b7551eba1 100644 --- a/rpcs3/basic_keyboard_handler.cpp +++ b/rpcs3/basic_keyboard_handler.cpp @@ -60,11 +60,21 @@ bool basic_keyboard_handler::eventFilter(QObject* target, QEvent* ev) void basic_keyboard_handler::keyPressEvent(QKeyEvent* keyEvent) { + if (keyEvent->isAutoRepeat() && !m_keyboards[0].m_key_repeat) + { + keyEvent->ignore(); + return; + } Key(keyEvent->key(), 1); } void basic_keyboard_handler::keyReleaseEvent(QKeyEvent* keyEvent) { + if (keyEvent->isAutoRepeat() && !m_keyboards[0].m_key_repeat) + { + keyEvent->ignore(); + return; + } Key(keyEvent->key(), 0); } From a27e2db4556e3f9bbe7d1da732ed08fa99d72039 Mon Sep 17 00:00:00 2001 From: isJuhn Date: Fri, 12 Jan 2018 18:41:56 +0100 Subject: [PATCH 03/54] Stub some functions in cellWebBrowser --- rpcs3/Emu/Cell/Modules/cellWebBrowser.cpp | 80 ++++++++++++++++------- rpcs3/Emu/Cell/Modules/cellWebBrowser.h | 11 ++++ 2 files changed, 68 insertions(+), 23 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellWebBrowser.cpp b/rpcs3/Emu/Cell/Modules/cellWebBrowser.cpp index b338fe5450..e8e5f8013f 100644 --- a/rpcs3/Emu/Cell/Modules/cellWebBrowser.cpp +++ b/rpcs3/Emu/Cell/Modules/cellWebBrowser.cpp @@ -2,9 +2,16 @@ #include "Emu/Cell/PPUModule.h" #include "cellWebBrowser.h" +#include "Emu/IdManager.h" extern logs::channel cellSysutil; +struct browser_t +{ + vm::ptr system_cb; + vm::ptr userData; +}; + s32 cellWebBrowserActivate() { fmt::throw_exception("Unimplemented" HERE); @@ -15,9 +22,10 @@ s32 cellWebBrowserConfig() fmt::throw_exception("Unimplemented" HERE); } -s32 cellWebBrowserConfig2() +error_code cellWebBrowserConfig2(vm::cptr config, u32 version) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutil.todo("cellWebBrowserConfig2(config=*0x%x, version=%d)", config, version); + return CELL_OK; } s32 cellWebBrowserConfigGetHeapSize() @@ -45,9 +53,10 @@ s32 cellWebBrowserConfigSetErrorHook2() fmt::throw_exception("Unimplemented" HERE); } -s32 cellWebBrowserConfigSetFullScreen2() +error_code cellWebBrowserConfigSetFullScreen2(vm::cptr config, u32 full) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutil.todo("cellWebBrowserConfigSetFullScreen2(config=*0x%x, full=%d)", config, full); + return CELL_OK; } s32 cellWebBrowserConfigSetFullVersion2() @@ -60,9 +69,10 @@ s32 cellWebBrowserConfigSetFunction() fmt::throw_exception("Unimplemented" HERE); } -s32 cellWebBrowserConfigSetFunction2() +error_code cellWebBrowserConfigSetFunction2(vm::ptr config, u32 funcset) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutil.todo("cellWebBrowserConfigSetFunction2(config=*0x%x, funcset=0x%x)", config, funcset); + return CELL_OK; } s32 cellWebBrowserConfigSetHeapSize() @@ -70,9 +80,10 @@ s32 cellWebBrowserConfigSetHeapSize() fmt::throw_exception("Unimplemented" HERE); } -s32 cellWebBrowserConfigSetHeapSize2() +error_code cellWebBrowserConfigSetHeapSize2(vm::ptr config, u32 size) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutil.todo("cellWebBrowserConfigSetHeapSize(config=*0x%x, size=0x%x)", config, size); + return CELL_OK; } s32 cellWebBrowserConfigSetMimeSet() @@ -80,9 +91,10 @@ s32 cellWebBrowserConfigSetMimeSet() fmt::throw_exception("Unimplemented" HERE); } -s32 cellWebBrowserConfigSetNotifyHook2() +error_code cellWebBrowserConfigSetNotifyHook2(vm::cptr config, vm::ptr cb, vm::ptr userdata) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutil.todo("cellWebBrowserConfigSetNotifyHook2(config=*0x%x, cb=*0x%x, userdata=*0x%x)", config, cb, userdata); + return CELL_OK; } s32 cellWebBrowserConfigSetRequestHook2() @@ -95,14 +107,16 @@ s32 cellWebBrowserConfigSetStatusHook2() fmt::throw_exception("Unimplemented" HERE); } -s32 cellWebBrowserConfigSetTabCount2() +error_code cellWebBrowserConfigSetTabCount2(vm::cptr config, u32 tab_count) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutil.todo("cellWebBrowserConfigSetTabCount2(config=*0x%x, tab_count=%d)", config, tab_count); + return CELL_OK; } -s32 cellWebBrowserConfigSetUnknownMIMETypeHook2() +error_code cellWebBrowserConfigSetUnknownMIMETypeHook2(vm::cptr config, vm::ptr cb, vm::ptr userdata) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutil.todo("cellWebBrowserConfigSetUnknownMIMETypeHook2(config=*0x%x, cb=*0x%x, userdata=*0x%x)", config, cb, userdata); + return CELL_OK; } s32 cellWebBrowserConfigSetVersion() @@ -110,9 +124,10 @@ s32 cellWebBrowserConfigSetVersion() fmt::throw_exception("Unimplemented" HERE); } -s32 cellWebBrowserConfigSetViewCondition2() +error_code cellWebBrowserConfigSetViewCondition2(vm::ptr config, u32 cond) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutil.todo("cellWebBrowserConfigSetViewCondition2(config=*0x%x, cond=0x%x)", config, cond); + return CELL_OK; } s32 cellWebBrowserConfigSetViewRect2() @@ -180,7 +195,7 @@ s32 cellWebBrowserEstimate() fmt::throw_exception("Unimplemented" HERE); } -s32 cellWebBrowserEstimate2(vm::cptr config, vm::ptr memSize) +error_code cellWebBrowserEstimate2(vm::cptr config, vm::ptr memSize) { cellSysutil.warning("cellWebBrowserEstimate2(config=*0x%x, memSize=*0x%x)", config, memSize); @@ -190,15 +205,26 @@ s32 cellWebBrowserEstimate2(vm::cptr config, vm::ptr return CELL_OK; } -s32 cellWebBrowserGetUsrdataOnGameExit(vm::ptr ptr) +error_code cellWebBrowserGetUsrdataOnGameExit(vm::ptr ptr) { - cellSysutil.todo("cellWebBrowserGetUsrdataOnGameExit(ptr=*0x%x", ptr); + cellSysutil.todo("cellWebBrowserGetUsrdataOnGameExit(ptr=*0x%x)", ptr); return CELL_OK; } -s32 cellWebBrowserInitialize() +error_code cellWebBrowserInitialize(vm::ptr system_cb, u32 container) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutil.todo("cellWebBrowserInitialize(system_cb=*0x%x, container=0x%x)", system_cb, container); + + const auto browser = fxm::make_always(); + browser->system_cb = system_cb; + + sysutil_register_cb([=](ppu_thread& ppu) -> s32 + { + system_cb(ppu, CELL_SYSUTIL_WEBBROWSER_INITIALIZING_FINISHED, browser->userData); + return CELL_OK; + }); + + return CELL_OK; } s32 cellWebBrowserNavigate2() @@ -216,9 +242,17 @@ s32 cellWebBrowserSetSystemCallbackUsrdata() fmt::throw_exception("Unimplemented" HERE); } -s32 cellWebBrowserShutdown() +void cellWebBrowserShutdown() { - fmt::throw_exception("Unimplemented" HERE); + cellSysutil.todo("cellWebBrowserShutdown()"); + + sysutil_register_cb([=](ppu_thread& ppu) -> s32 + { + const auto browser = fxm::get_always(); + + browser->system_cb(ppu, CELL_SYSUTIL_WEBBROWSER_SHUTDOWN_FINISHED, browser->userData); + return CELL_OK; + }); } s32 cellWebBrowserUpdatePointerDisplayPos2() diff --git a/rpcs3/Emu/Cell/Modules/cellWebBrowser.h b/rpcs3/Emu/Cell/Modules/cellWebBrowser.h index 0b6254b05c..050156dbaf 100644 --- a/rpcs3/Emu/Cell/Modules/cellWebBrowser.h +++ b/rpcs3/Emu/Cell/Modules/cellWebBrowser.h @@ -2,6 +2,17 @@ #include "cellSysutil.h" +//events +enum CellWebBrowserEvent : s32 +{ + CELL_SYSUTIL_WEBBROWSER_INITIALIZING_FINISHED = 1, + CELL_SYSUTIL_WEBBROWSER_SHUTDOWN_FINISHED = 4, + CELL_SYSUTIL_WEBBROWSER_LOADING_FINISHED = 5, + CELL_SYSUTIL_WEBBROWSER_UNLOADING_FINISHED = 7, + CELL_SYSUTIL_WEBBROWSER_RELEASED = 9, + CELL_SYSUTIL_WEBBROWSER_GRABBED = 11, +}; + using CellWebBrowserCallback = void(s32 cb_type, vm::ptr client_session, vm::ptr usrdata); using CellWebComponentCallback = void(s32 web_browser_id, s32 cb_type, vm::ptr client_session, vm::ptr usrdata); using CellWebBrowserSystemCallback = void(s32 cb_type, vm::ptr usrdata); From cd8e97a7c6551e58167095b9a1af4d5a536de74c Mon Sep 17 00:00:00 2001 From: ZeroZero2018 <35616470+ZeroZero2018@users.noreply.github.com> Date: Mon, 29 Jan 2018 10:58:25 -0800 Subject: [PATCH 04/54] Fix to B8 format render target swizzling (#4123) --- rpcs3/Emu/RSX/GL/GLRenderTargets.cpp | 3 ++- rpcs3/Emu/RSX/VK/VKGSRender.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp index 700d2c8ee1..78925df545 100644 --- a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp +++ b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp @@ -31,7 +31,8 @@ color_format rsx::internals::surface_color_format_to_gl(rsx::surface_color_forma return{ ::gl::texture::type::f32, ::gl::texture::format::rgba, true, 4, 4 }; case rsx::surface_color_format::b8: - return{ ::gl::texture::type::ubyte, ::gl::texture::format::r, false, 1, 1 }; + return{ ::gl::texture::type::ubyte, ::gl::texture::format::r, false, 1, 1, + { ::gl::texture::channel::one, ::gl::texture::channel::r, ::gl::texture::channel::r, ::gl::texture::channel::r } }; case rsx::surface_color_format::g8b8: return{ ::gl::texture::type::ubyte, ::gl::texture::format::rg, false, 2, 1 }; diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index ec144a6823..5233949309 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -84,7 +84,10 @@ namespace vk } case rsx::surface_color_format::b8: - return std::make_pair(VK_FORMAT_R8_UNORM, vk::default_component_map()); + { + VkComponentMapping no_alpha = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_ONE }; + return std::make_pair(VK_FORMAT_R8_UNORM, no_alpha); + } case rsx::surface_color_format::g8b8: return std::make_pair(VK_FORMAT_R8G8_UNORM, vk::default_component_map()); @@ -3194,4 +3197,4 @@ void VKGSRender::shell_do_cleanup() { //TODO: Guard this m_overlay_cleanup_requests.push_back(0); -} \ No newline at end of file +} From d37aa466ff2125dc52fc1f15410ba895549cb1c9 Mon Sep 17 00:00:00 2001 From: Juhn Date: Tue, 30 Jan 2018 14:26:00 +0100 Subject: [PATCH 05/54] Fix native UI save_dialog when there are no saves (#4113) - Also implements single action list view with cancel action only --- rpcs3/Emu/RSX/overlay_controls.h | 17 ++++++++++++++++- rpcs3/Emu/RSX/overlays.h | 23 +++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/overlay_controls.h b/rpcs3/Emu/RSX/overlay_controls.h index 2046c0ae81..4a148f1fc6 100644 --- a/rpcs3/Emu/RSX/overlay_controls.h +++ b/rpcs3/Emu/RSX/overlay_controls.h @@ -1331,6 +1331,8 @@ namespace rsx s16 m_selected_entry = -1; u16 m_elements_count = 0; + bool m_cancel_only = false; + public: list_view(u16 width, u16 height) { @@ -1461,6 +1463,17 @@ namespace rsx return m_items[m_selected_entry]->text; } + void set_cancel_only(bool cancel_only) + { + if (cancel_only) + m_cancel_btn->set_pos(x + 30, y + h + 20); + else + m_cancel_btn->set_pos(x + 180, y + h + 20); + + m_cancel_only = cancel_only; + is_compiled = false; + } + void translate(s16 _x, s16 _y) override { layout_container::translate(_x, _y); @@ -1478,9 +1491,11 @@ namespace rsx compiled.add(m_highlight_box->get_compiled()); compiled.add(m_scroll_indicator_top->get_compiled()); compiled.add(m_scroll_indicator_bottom->get_compiled()); - compiled.add(m_accept_btn->get_compiled()); compiled.add(m_cancel_btn->get_compiled()); + if (!m_cancel_only) + compiled.add(m_accept_btn->get_compiled()); + compiled_resources = compiled; } diff --git a/rpcs3/Emu/RSX/overlays.h b/rpcs3/Emu/RSX/overlays.h index 8539186d0e..45c89ba92a 100644 --- a/rpcs3/Emu/RSX/overlays.h +++ b/rpcs3/Emu/RSX/overlays.h @@ -254,6 +254,7 @@ namespace rsx std::unique_ptr m_list; std::unique_ptr