Compare commits

...

12 Commits

Author SHA1 Message Date
zarroboogs dc55d5be8f linux appimage versioning changes synced with windows artifact version 2018-02-24 15:06:08 +00:00
zarroboogs 06546b5195 windows artifact versioning changes, plus a small syntax fix 2018-02-24 15:06:08 +00:00
zarroboogs ca9c1674f7 minor syntax changes 2018-02-24 15:06:08 +00:00
scribam ede76033a7 Add callbacks for cellMusic 2018-02-24 02:38:43 +04:00
Nikolay Amiantov 41bd07274f Fix quoting in cmake 2018-02-23 19:06:37 +00:00
Megamouse 5266dd6c60 Update for Qt 5.10 (#4202)
* Update Readme for Qt 5.10

* Update cmake for Qt 5.10

* Update travis to Qt 5.10.1
2018-02-23 02:08:14 +04:00
Megamouse cf1c45dfe8 Qt: use setAttribute(AA_DisableWindowContextHelpButton) instead of flags
probably needs Qt 5.10.1 to work propery
2018-02-22 00:18:14 +04:00
Megamouse ae7e275a9d sceNpTrophyGetRequiredDiskSpace: take vfs into account for trophy dir 2018-02-22 00:18:14 +04:00
Megamouse b60f29282a Qt: add translation to save manager messageboxes 2018-02-22 00:18:14 +04:00
Megamouse bda466c3bd Qt: improve VFS dialog a bit
- use normal selection instead of doubleclick
- move SaveSettings out of the tabs to reduce file access
- translate EmptyPath as well
- some other minor refactors to reduce lines of code
2018-02-22 00:18:14 +04:00
kd-11 4c6ceeff11 rsx/vk: Cleanup
- Silence some warnings, remove dprints
2018-02-21 14:59:46 +03:00
kd-11 77f2b521e1 vulkan: Swapchains reimplemented
- Adds support for abstract implementations
- Adds native windowing implementations for WIN32 and X11 as fallbacks
  when present support is lacking (headless configs)
2018-02-21 14:59:46 +03:00
42 changed files with 1124 additions and 617 deletions
+11 -9
View File
@@ -52,7 +52,7 @@ before_script:
- git submodule update --init asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/GSL 3rdparty/libpng Utilities/yaml-cpp 3rdparty/cereal 3rdparty/hidapi 3rdparty/Optional Vulkan/glslang Vulkan/Vulkan-LoaderAndValidationLayers
- mkdir build
- cd build
- export CMAKE_PREFIX_PATH=~/Qt/5.10.0/gcc_64/lib/cmake
- export CMAKE_PREFIX_PATH=~/Qt/5.10.1/gcc_64/lib/cmake
- export CXXFLAGS="$CXXFLAGS -DTRAVIS=true";
- if [ "$TRAVIS_PULL_REQUEST" = false ]; then
export CXXFLAGS="$CXXFLAGS -DBRANCH=$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH";
@@ -63,25 +63,27 @@ before_script:
- ninja
- # AppImage generation
- 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;
export LD_LIBRARY_PATH=~/Qt/5.10.1/gcc_64/lib;
DESTDIR=appdir ninja install ; find appdir/ ;
find ../bin ;
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" ;
chmod a+x linuxdeployqt*.AppImage ;
export PATH=~/Qt/5.10.0/gcc_64/bin/:${PATH} ;
export PATH=~/Qt/5.10.1/gcc_64/bin/:${PATH} ;
./linuxdeployqt*.AppImage --appimage-extract ;
./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs ;
mkdir ./appdir/usr/plugins/xcbglintegrations/ ;
mkdir ./appdir/usr/plugins/imageformats/ ;
cp ~/Qt/5.10.0/gcc_64/lib/libQt5Svg.so.5 ./appdir/usr/lib/ ;
cp ~/Qt/5.10.0/gcc_64/plugins/xcbglintegrations/* ./appdir/usr/plugins/xcbglintegrations/ ;
cp ~/Qt/5.10.0/gcc_64/plugins/imageformats/* ./appdir/usr/plugins/imageformats/ ;
cp ~/Qt/5.10.0/gcc_64/plugins/platforms/* ./appdir/usr/plugins/platforms/ ;
cp ~/Qt/5.10.1/gcc_64/lib/libQt5Svg.so.5 ./appdir/usr/lib/ ;
cp ~/Qt/5.10.1/gcc_64/plugins/xcbglintegrations/* ./appdir/usr/plugins/xcbglintegrations/ ;
cp ~/Qt/5.10.1/gcc_64/plugins/imageformats/* ./appdir/usr/plugins/imageformats/ ;
cp ~/Qt/5.10.1/gcc_64/plugins/platforms/* ./appdir/usr/plugins/platforms/ ;
rm ./appdir/usr/lib/libfreetype.so.6 ;
export PATH=${TRAVIS_BUILD_DIR}/build/squashfs-root/usr/bin/:${PATH} ;
./squashfs-root/usr/bin/appimagetool ${TRAVIS_BUILD_DIR}/build/appdir ;
find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq ;
curl ${UPLOAD_URL}${TRAVIS_COMMIT:0:7}-${TRAVIS_BUILD_NUMBER}_linux64 --upload-file ./RPCS3*.AppImage;
COMM_TAG="$(git describe --tags $(git rev-list --tags --max-count=1))"
COMM_COUNT="$(git rev-list --count HEAD)"
curl "${UPLOAD_URL}${TRAVIS_COMMIT:0:8}&t=${COMM_TAG}&a=${COMM_COUNT}" --upload-file ./RPCS3*.AppImage;
fi;
script:
@@ -117,7 +119,7 @@ addons:
- libstdc++-5-dev
- lib32stdc++6
- zlib1g-dev
# We need to install qt 5.10.0 manually because the version trusty provides is too old.
# We need to install qt 5.10.1 manually because the version trusty provides is too old.
#- qtbase5-dev
- libudev-dev
- libevdev-dev
+4 -4
View File
@@ -24,11 +24,11 @@ If you want to contribute please take a look at the [Coding Style](https://githu
* [Visual C++ Redistributable Packages for Visual Studio 2015](http://www.microsoft.com/en-us/download/details.aspx?id=48145)
* [Cmake 3.1.0+](https://www.cmake.org/download/) (required; add to PATH)
* [Python 3.3+](https://www.python.org/downloads/) (required; add to PATH)
* [Qt 5.8+](https://www.qt.io/download-open-source/) (required; add QTDIR `<QtInstallFolder>\5.8\msvc2015_64\` environment variable if you do not want to use the Visual Studio Qt Plugin)
* [Qt 5.10+](https://www.qt.io/download-open-source/) (required; add QTDIR environment variable if you do not want to use the Visual Studio Qt Plugin: e.g. `<QtInstallFolder>\5.10.1\msvc2015_64\`)
* [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2015) (optional; see above)
### Linux
* [Qt 5.7+](https://www.qt.io/download-open-source/)
* [Qt 5.10+](https://www.qt.io/download-open-source/)
* GCC 5.1+ or Clang 3.5.0+ ([not GCC 6.1](https://github.com/RPCS3/rpcs3/issues/1691))
* Debian & Ubuntu: `sudo apt-get install cmake build-essential libasound2-dev libpulse-dev libopenal-dev libglew-dev zlib1g-dev libedit-dev libvulkan-dev libudev-dev git qt5-default`
* Arch: `sudo pacman -S glew openal cmake llvm qt5-base`
@@ -48,14 +48,14 @@ To initialize the repository don't forget to execute `git submodule update --ini
### Configuring Qt
*If you're using Visual Studio 2017 without Qt plugin support (or simply dont want to use it):*
1) Add `QTDIR` environment variable and set it to `<QtInstallFolder>\5.8\msvc2015_64\` </br>
1) Add `QTDIR` environment variable and set it to e.g `<QtInstallFolder>\5.10.1\msvc2015_64\` </br>
Open `rpcs3.sln`
*If you wish to use the Visual Studio plugin for Qt:* </br>
1) Go to the Qt5 menu and edit Qt5 options. Add the path to your Qt installation with compiler e.g. `C:\Qt\5.8\msvc2015_64`. </br>
1) Go to the Qt5 menu and edit Qt5 options. Add the path to your Qt installation with compiler e.g. `C:\Qt\5.10.1\msvc2015_64`. </br>
2) While selecting the rpcs3qt project, go to Qt5->Project Setting and select the version you added.
### Building the projects
+15 -8
View File
@@ -16,12 +16,19 @@ cache:
install:
- ps: | # set env vars for versioning
$commDate = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP.Substring(0,10)
$commSha = $env:APPVEYOR_REPO_COMMIT.Substring(0,8)
$commTag = $(git describe --tags $(git rev-list --tags --max-count=1))
$commCount = $(git rev-list --count HEAD)
$commHash = $env:APPVEYOR_REPO_COMMIT.Substring(0,8)
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
$env:BUILD = "{0}-{1}" -f $commTag, $commHash
}
else {
$env:BUILD = "{0}-{1}-{2}" -f $commTag, $commCount, $commHash
}
$env:AVVER = "{0}-{1}" -f $commTag.TrimStart("v"), $env:APPVEYOR_BUILD_NUMBER
$env:BUILD = "rpcs3-{0}-{1}-{2}_win64.7z" -f $commTag, $commDate, $commSha
$env:RPCS3 = "rpcs3-{0}_win64.7z" -f $env:BUILD
- ps: | # used for experimental build warnings for pr builds
$env:BRANCH = "{0}/{1}/#{2}" -f $env:APPVEYOR_REPO_NAME, `
@@ -75,20 +82,20 @@ after_build:
copy-item compat_database.dat .\bin\GuiConfigs\compat_database.dat
- ps: | # package artifacts
7z a -m0=LZMA2 -mx9 $env:BUILD .\bin\*
7z a -m0=LZMA2 -mx9 $env:RPCS3 .\bin\*
7z a -m0=LZMA2 -mx9 openssl_win64.7z C:\OpenSSL-Win64\bin\libeay32.dll `
C:\OpenSSL-Win64\bin\ssleay32.dll
- ps: | # generate sha256 hashes
(Get-FileHash $env:BUILD -Algorithm SHA256).Hash | Out-File -encoding ASCII "$($env:BUILD).sha256"
(Get-FileHash openssl_win64.7z -Algorithm SHA256).Hash | Out-File -encoding ASCII "openssl_win64.7z.sha256"
(get-filehash $env:RPCS3 -algorithm SHA256).Hash > ("{0}.sha256" -f $env:RPCS3)
(get-filehash openssl_win64.7z -algorithm SHA256).Hash > "openssl_win64.7z.sha256"
test: off
artifacts:
- path: $(BUILD)
- path: $(RPCS3)
name: rpcs3
- path: $(BUILD).sha256
- path: $(RPCS3).sha256
name: rpcs3 sha256 hash
- path: openssl_win64.7z
name: openssl
+1 -1
View File
@@ -33,7 +33,7 @@ Controller.prototype.ComponentSelectionPageCallback = function() {
var widget = gui.currentPageWidget();
widget.deselectAll();
widget.selectComponent("qt.qt5.5100.gcc_64");
widget.selectComponent("qt.qt5.5101.gcc_64");
gui.clickButton(buttons.NextButton);
}
+10 -10
View File
@@ -6,12 +6,12 @@ set(CMAKE_CXX_STANDARD 14)
include(CheckCXXCompilerFlag)
# Qt section
find_package(Qt5 5.7 COMPONENTS Widgets Network)
find_package(Qt5 5.10 COMPONENTS Widgets Network)
if(WIN32)
find_package(Qt5 5.7 COMPONENTS WinExtras REQUIRED)
find_package(Qt5 5.10 COMPONENTS WinExtras REQUIRED)
set(RPCS3_QT_LIBS Qt5::Widgets Qt5::WinExtras Qt5::Network)
else()
find_package(Qt5 5.7 COMPONENTS DBus Gui)
find_package(Qt5 5.10 COMPONENTS DBus Gui)
if(Qt5DBus_FOUND)
set(RPCS3_QT_LIBS Qt5::Widgets Qt5::DBus Qt5::Network)
add_definitions(-DHAVE_QTDBUS)
@@ -23,15 +23,15 @@ endif()
# Let's make sure we have Qt before we continue
if(NOT Qt5Widgets_FOUND)
if(Qt5Widgets_VERSION VERSION_LESS 5.7.0)
message("Minimum supported Qt5 version is 5.7! You have version ${Qt5Widgets_VERSION} installed, please upgrade!")
if(Qt5Widgets_VERSION VERSION_LESS 5.10.0)
message("Minimum supported Qt5 version is 5.10.0! You have version ${Qt5Widgets_VERSION} installed, please upgrade!")
if("${CMAKE_SYSTEM}" MATCHES "Linux")
message(FATAL_ERROR "Most distros do not provide an up-to-date version of Qt.
If you're on Ubuntu or Linux Mint, there are PPAs you can use to install an up-to-date qt5 version.
https://launchpad.net/~beineri/+archive/ubuntu/opt-qt593-xenial
https://launchpad.net/~beineri/+archive/ubuntu/opt-qt593-trusty
https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.10.1-xenial
https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.10.1-trusty
just make sure to run
source /opt/qt59/bin/qt59-env.sh
source /opt/qt510/bin/qt510-env.sh
before re-running cmake")
elseif(WIN32)
message(FATAL_ERROR "You can download the latest version of Qt5 here: https://www.qt.io/download-open-source/")
@@ -42,7 +42,7 @@ before re-running cmake")
message("CMake was unable to find Qt5!")
if(WIN32)
message(FATAL_ERROR "Make sure the QTDIR env variable has been set properly. (for example C:\\Qt\\5.8\\msvc2017_64\\)")
message(FATAL_ERROR "Make sure the QTDIR env variable has been set properly. (for example C:\\Qt\\5.10.1\\msvc2017_64\\)")
elseif("${CMAKE_SYSTEM}" MATCHES "Linux")
message(FATAL_ERROR "Make sure to install your distro's qt5 package!")
else()
@@ -394,7 +394,7 @@ if(NOT MSVC)
endif()
if(WIN32)
target_link_libraries(rpcs3 ws2_32.lib Winmm.lib Psapi.lib VKstatic.1 glslang OSDependent OGLCompiler SPIRV HLSL setupapi.lib hidapi-hid Shlwapi.lib)
target_link_libraries(rpcs3 ws2_32.lib Winmm.lib Psapi.lib gdi32.lib VKstatic.1 glslang OSDependent OGLCompiler SPIRV HLSL setupapi.lib hidapi-hid Shlwapi.lib)
if(NOT MSVC)
target_link_libraries(rpcs3 ${OPENGL_LIBRARIES} opengl32.lib glu32.lib libpthread)
else()
+214 -46
View File
@@ -2,131 +2,287 @@
#include "Emu/System.h"
#include "Emu/IdManager.h"
#include "Emu/Cell/PPUModule.h"
#include "cellMusic.h"
#include "Emu/Cell/lv2/sys_lwmutex.h"
#include "Emu/Cell/lv2/sys_lwcond.h"
#include "Emu/Cell/lv2/sys_spu.h"
#include "cellSearch.h"
#include "cellSpurs.h"
#include "cellSysutil.h"
#include "cellMusic.h"
logs::channel cellMusic("cellMusic");
struct music2_t
struct music_t
{
vm::ptr<CellMusic2Callback> func;
vm::ptr<void(u32 event, vm::ptr<void> param, vm::ptr<void> userData)> func;
vm::ptr<void> userData;
};
s32 cellMusicGetSelectionContext()
s32 cellMusicGetSelectionContext(vm::ptr<CellMusicSelectionContext> context)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicGetSelectionContext(context=*0x%x)", context);
return CELL_OK;
}
s32 cellMusicSetSelectionContext2()
s32 cellMusicSetSelectionContext2(vm::ptr<CellMusicSelectionContext> context)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicSetSelectionContext2(context=*0x%x)", context);
const auto music = fxm::get_always<music_t>();
if (!music->func)
return CELL_MUSIC2_ERROR_GENERIC;
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
music->func(ppu, CELL_MUSIC2_EVENT_SET_SELECTION_CONTEXT_RESULT, vm::addr_t(CELL_OK), music->userData);
return CELL_OK;
});
return CELL_OK;
}
s32 cellMusicSetVolume2()
s32 cellMusicSetVolume2(f32 level)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicSetVolume2(level=0x%x)", level);
const auto music = fxm::get_always<music_t>();
if (!music->func)
return CELL_MUSIC2_ERROR_GENERIC;
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
music->func(ppu, CELL_MUSIC2_EVENT_SET_VOLUME_RESULT, vm::addr_t(CELL_OK), music->userData);
return CELL_OK;
});
return CELL_OK;
}
s32 cellMusicGetContentsId()
s32 cellMusicGetContentsId(vm::ptr<CellSearchContentId> contents_id)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicGetContentsId(contents_id=*0x%x)", contents_id);
return CELL_OK;
}
s32 cellMusicSetSelectionContext()
s32 cellMusicSetSelectionContext(vm::ptr<CellMusicSelectionContext> context)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicSetSelectionContext(context=*0x%x)", context);
const auto music = fxm::get_always<music_t>();
if (!music->func)
return CELL_MUSIC_ERROR_GENERIC;
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
music->func(ppu, CELL_MUSIC_EVENT_SET_SELECTION_CONTEXT_RESULT, vm::addr_t(CELL_OK), music->userData);
return CELL_OK;
});
return CELL_OK;
}
s32 cellMusicInitialize2SystemWorkload()
s32 cellMusicInitialize2SystemWorkload(s32 mode, vm::ptr<CellMusic2Callback> func, vm::ptr<void> userData, vm::ptr<CellSpurs> spurs, vm::cptr<u8> priority, vm::cptr<struct CellSpursSystemWorkloadAttribute> attr)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicInitialize2SystemWorkload(mode=0x%x, func=*0x%x, userData=*0x%x, spurs=*0x%x, priority=*0x%x, attr=*0x%x)", mode, func, userData, spurs, priority, attr);
const auto music = fxm::make_always<music_t>();
music->func = func;
music->userData = userData;
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
music->func(ppu, CELL_MUSIC2_EVENT_INITIALIZE_RESULT, vm::addr_t(CELL_OK), userData);
return CELL_OK;
});
return CELL_OK;
}
s32 cellMusicGetPlaybackStatus2()
s32 cellMusicGetPlaybackStatus2(vm::ptr<s32> status)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicGetPlaybackStatus2(status=*0x%x)", status);
return CELL_OK;
}
s32 cellMusicGetContentsId2()
s32 cellMusicGetContentsId2(vm::ptr<CellSearchContentId> contents_id)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicGetContentsId2(contents_id=*0x%x)", contents_id);
return CELL_OK;
}
s32 cellMusicFinalize()
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicFinalize()");
const auto music = fxm::get_always<music_t>();
if (music->func)
{
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
music->func(ppu, CELL_MUSIC_EVENT_FINALIZE_RESULT, vm::addr_t(CELL_OK), music->userData);
return CELL_OK;
});
}
return CELL_OK;
}
s32 cellMusicInitializeSystemWorkload()
s32 cellMusicInitializeSystemWorkload(s32 mode, u32 container, vm::ptr<CellMusicCallback> func, vm::ptr<void> userData, vm::ptr<CellSpurs> spurs, vm::cptr<u8> priority, vm::cptr<struct CellSpursSystemWorkloadAttribute> attr)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicInitializeSystemWorkload(mode=0x%x, container=0x%x, func=*0x%x, userData=*0x%x, spurs=*0x%x, priority=*0x%x, attr=*0x%x)", mode, container, func, userData, spurs, priority, attr);
if (mode != CELL_MUSIC2_PLAYER_MODE_NORMAL)
{
cellMusic.todo("Unknown player mode: 0x%x", mode);
return CELL_MUSIC_ERROR_PARAM;
}
const auto music = fxm::make_always<music_t>();
music->func = func;
music->userData = userData;
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
music->func(ppu, CELL_MUSIC_EVENT_INITIALIZE_RESULT, vm::addr_t(CELL_OK), userData);
return CELL_OK;
});
return CELL_OK;
}
s32 cellMusicInitialize()
s32 cellMusicInitialize(s32 mode, u32 container, s32 spuPriority, vm::ptr<CellMusicCallback> func, vm::ptr<void> userData)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicInitialize(mode=0x%x, container=0x%x, spuPriority=0x%x, func=*0x%x, userData=*0x%x)", mode, container, spuPriority, func, userData);
if (mode != CELL_MUSIC2_PLAYER_MODE_NORMAL)
{
cellMusic.todo("Unknown player mode: 0x%x", mode);
return CELL_MUSIC_ERROR_PARAM;
}
const auto music = fxm::make_always<music_t>();
music->func = func;
music->userData = userData;
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
music->func(ppu, CELL_MUSIC_EVENT_INITIALIZE_RESULT, vm::addr_t(CELL_OK), userData);
return CELL_OK;
});
return CELL_OK;
}
s32 cellMusicFinalize2()
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicFinalize2()");
const auto music = fxm::get_always<music_t>();
if (music->func)
{
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
music->func(ppu, CELL_MUSIC2_EVENT_FINALIZE_RESULT, vm::addr_t(CELL_OK), music->userData);
return CELL_OK;
});
}
return CELL_OK;
}
s32 cellMusicGetSelectionContext2()
s32 cellMusicGetSelectionContext2(vm::ptr<CellMusicSelectionContext> context)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicGetSelectionContext2(context=*0x%x)", context);
return CELL_OK;
}
s32 cellMusicGetVolume()
s32 cellMusicGetVolume(vm::ptr<f32> level)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicGetVolume(level=*0x%x)", level);
return CELL_OK;
}
s32 cellMusicGetPlaybackStatus()
s32 cellMusicGetPlaybackStatus(vm::ptr<s32> status)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicGetPlaybackStatus(status=*0x%x)", status);
return CELL_OK;
}
s32 cellMusicSetPlaybackCommand2()
s32 cellMusicSetPlaybackCommand2(s32 command, vm::ptr<void> param)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicSetPlaybackCommand2(command=0x%x, param=*0x%x)", command, param);
const auto music = fxm::get_always<music_t>();
if (!music->func)
return CELL_MUSIC2_ERROR_GENERIC;
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
music->func(ppu, CELL_MUSIC2_EVENT_SET_PLAYBACK_COMMAND_RESULT, vm::addr_t(CELL_OK), music->userData);
return CELL_OK;
});
return CELL_OK;
}
s32 cellMusicSetPlaybackCommand()
s32 cellMusicSetPlaybackCommand(s32 command, vm::ptr<void> param)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicSetPlaybackCommand(command=0x%x, param=*0x%x)", command, param);
const auto music = fxm::get_always<music_t>();
if (!music->func)
return CELL_MUSIC_ERROR_GENERIC;
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
music->func(ppu, CELL_MUSIC_EVENT_SET_PLAYBACK_COMMAND_RESULT, vm::addr_t(CELL_OK), music->userData);
return CELL_OK;
});
return CELL_OK;
}
s32 cellMusicSelectContents2()
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicSelectContents2()");
const auto music = fxm::get_always<music_t>();
if (!music->func)
return CELL_MUSIC2_ERROR_GENERIC;
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
music->func(ppu, CELL_MUSIC2_EVENT_SELECT_CONTENTS_RESULT, vm::addr_t(CELL_OK), music->userData);
return CELL_OK;
});
return CELL_OK;
}
s32 cellMusicSelectContents()
s32 cellMusicSelectContents(u32 container)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicSelectContents(container=0x%x)", container);
const auto music = fxm::get_always<music_t>();
if (!music->func)
return CELL_MUSIC_ERROR_GENERIC;
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
music->func(ppu, CELL_MUSIC_EVENT_SELECT_CONTENTS_RESULT, vm::addr_t(CELL_OK), music->userData);
return CELL_OK;
});
return CELL_OK;
}
@@ -140,28 +296,40 @@ s32 cellMusicInitialize2(s32 mode, s32 spuPriority, vm::ptr<CellMusic2Callback>
return CELL_MUSIC2_ERROR_PARAM;
}
const auto music = fxm::make_always<music2_t>();
const auto music = fxm::make_always<music_t>();
music->func = func;
music->userData = userData;
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
func(ppu, CELL_MUSIC2_EVENT_INITIALIZE_RESULT, vm::make_var<s32>(CELL_OK), userData);
music->func(ppu, CELL_MUSIC2_EVENT_INITIALIZE_RESULT, vm::addr_t(CELL_OK), userData);
return CELL_OK;
});
return CELL_OK;
}
s32 cellMusicSetVolume()
s32 cellMusicSetVolume(f32 level)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicSetVolume(level=0x%x)", level);
const auto music = fxm::get_always<music_t>();
if (!music->func)
return CELL_MUSIC_ERROR_GENERIC;
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
music->func(ppu, CELL_MUSIC_EVENT_SET_VOLUME_RESULT, vm::addr_t(CELL_OK), music->userData);
return CELL_OK;
});
return CELL_OK;
}
s32 cellMusicGetVolume2()
s32 cellMusicGetVolume2(vm::ptr<f32> level)
{
UNIMPLEMENTED_FUNC(cellMusic);
cellMusic.todo("cellMusicGetVolume2(level=*0x%x)", level);
return CELL_OK;
}
+2 -2
View File
@@ -12,8 +12,8 @@ enum
CELL_MUSIC_ERROR_PLAYBACK_FAILURE = 0x8002c107,
CELL_MUSIC_ERROR_NO_MORE_CONTENT = 0x8002c108,
CELL_MUSIC_DIALOG_OPEN = 0x8002c109,
CELL_MUSIC_DIALOG_CLOSE = 0x8002c10A,
CELL_MUSIC_ERROR_GENERIC = 0x8002c1FF,
CELL_MUSIC_DIALOG_CLOSE = 0x8002c10a,
CELL_MUSIC_ERROR_GENERIC = 0x8002c1ff,
CELL_MUSIC2_PLAYBACK_FINISHED = CELL_MUSIC_PLAYBACK_FINISHED,
CELL_MUSIC2_ERROR_PARAM = CELL_MUSIC_ERROR_PARAM,
+2 -1
View File
@@ -2,9 +2,10 @@
#include "Emu/System.h"
#include "Emu/IdManager.h"
#include "Emu/Cell/PPUModule.h"
#include "cellMusic.h"
#include "cellSysutil.h"
#include "cellSearch.h"
#include "cellSysutil.h"
logs::channel cellSearch("cellSearch");
-6
View File
@@ -32,7 +32,6 @@ enum
CELL_SEARCH_TITLE_LEN_MAX = 384,
CELL_SEARCH_TAG_NUM_MAX = 6,
CELL_SEARCH_TAG_LEN_MAX = 63,
CELL_MUSIC_SELECTION_CONTEXT_SIZE = 2048,
CELL_SEARCH_PATH_LEN_MAX = 63,
CELL_SEARCH_MTOPTION_LEN_MAX = 63,
CELL_SEARCH_DEVELOPERDATA_LEN_MAX = 64,
@@ -339,11 +338,6 @@ struct CellSearchVideoSceneInfo
char tags[CELL_SEARCH_TAG_NUM_MAX][CELL_SEARCH_TAG_LEN_MAX];
};
struct CellMusicSelectionContext
{
char data[CELL_MUSIC_SELECTION_CONTEXT_SIZE];
};
struct CellSearchContentInfoPath
{
char contentPath[CELL_SEARCH_PATH_LEN_MAX + 1];
+1 -1
View File
@@ -352,7 +352,7 @@ error_code sceNpTrophyGetRequiredDiskSpace(u32 context, u32 handle, vm::ptr<u64>
return SCE_NP_TROPHY_ERROR_UNKNOWN_HANDLE;
}
if (!fs::is_dir("/dev_hdd0/home/00000001/trophy/" + ctxt->trp_name))
if (!fs::is_dir(vfs::get("/dev_hdd0/home/00000001/trophy/" + ctxt->trp_name)))
{
TRPLoader trp(ctxt->trp_stream);
+1 -1
View File
@@ -194,7 +194,7 @@ namespace gl
public:
void reset(u32 base, u32 size, bool flushable=false)
void reset(u32 base, u32 size, bool /*flushable*/=false)
{
rsx::protection_policy policy = g_cfg.video.strict_rendering_mode ? rsx::protection_policy::protect_policy_full_range : rsx::protection_policy::protect_policy_conservative;
rsx::buffered_section::reset(base, size, policy);
+85 -105
View File
@@ -472,8 +472,6 @@ namespace
VKGSRender::VKGSRender() : GSRender()
{
//shaders_cache.load(rsx::old_shaders_cache::shader_language::glsl);
u32 instance_handle = m_thread_context.createInstance("RPCS3");
if (instance_handle > 0)
@@ -505,60 +503,44 @@ VKGSRender::VKGSRender() : GSRender()
display_handle_t display = m_frame->handle();
#ifdef _WIN32
HINSTANCE hInstance = NULL;
for (auto &gpu : gpus)
{
if (gpu.name() == adapter_name)
{
m_swap_chain = m_thread_context.createSwapChain(hInstance, display, gpu);
gpu_found = true;
break;
}
}
if (!gpu_found || adapter_name.empty())
{
m_swap_chain = m_thread_context.createSwapChain(hInstance, display, gpus[0]);
}
#elif HAVE_VULKAN
display.match([](std::pair<Display*, Window> p) { XFlush(p.first); }, [](auto _) {});
for (auto &gpu : gpus)
{
if (gpu.name() == adapter_name)
{
m_swap_chain = m_thread_context.createSwapChain(display, gpu);
gpu_found = true;
break;
}
}
if (!gpu_found || adapter_name.empty())
{
m_swap_chain = m_thread_context.createSwapChain(display, gpus[0]);
}
display.match([&](std::pair<Display*, Window> p) { m_display_handle = p.first; }, [](auto _) {});
#ifndef _WIN32
display.match([this](std::pair<Display*, Window> p) { m_display_handle = p.first; XFlush(m_display_handle); }, [](auto _) {});
#endif
m_device = (vk::render_device *)(&m_swap_chain->get_device());
for (auto &gpu : gpus)
{
if (gpu.name() == adapter_name)
{
m_swapchain.reset(m_thread_context.createSwapChain(display, gpu));
gpu_found = true;
break;
}
}
m_memory_type_mapping = get_memory_mapping(m_device->gpu());
if (!gpu_found || adapter_name.empty())
{
m_swapchain.reset(m_thread_context.createSwapChain(display, gpus[0]));
}
if (!m_swapchain)
{
m_device = VK_NULL_HANDLE;
LOG_FATAL(RSX, "Could not successfully initialize a swapchain");
return;
}
m_device = (vk::render_device*)(&m_swapchain->get_device());
m_memory_type_mapping = m_device->get_memory_mapping();
m_optimal_tiling_supported_formats = vk::get_optimal_tiling_supported_formats(m_device->gpu());
vk::set_current_thread_ctx(m_thread_context);
vk::set_current_renderer(m_swap_chain->get_device());
vk::set_current_renderer(m_swapchain->get_device());
m_client_width = m_frame->client_width();
m_client_height = m_frame->client_height();
if (!m_swap_chain->init_swapchain(m_client_width, m_client_height))
if (!m_swapchain->init(m_client_width, m_client_height))
present_surface_dirty_flag = true;
//create command buffer...
@@ -619,7 +601,7 @@ VKGSRender::VKGSRender() : GSRender()
if (g_cfg.video.overlay)
{
size_t idx = vk::get_render_pass_location( m_swap_chain->get_surface_format(), VK_FORMAT_UNDEFINED, 1);
size_t idx = vk::get_render_pass_location( m_swapchain->get_surface_format(), VK_FORMAT_UNDEFINED, 1);
m_text_writer.reset(new vk::text_writer());
m_text_writer->init(*m_device, m_memory_type_mapping, m_render_passes[idx]);
}
@@ -641,25 +623,22 @@ VKGSRender::VKGSRender() : GSRender()
open_command_buffer();
for (u32 i = 0; i < m_swap_chain->get_swap_image_count(); ++i)
for (u32 i = 0; i < m_swapchain->get_swap_image_count(); ++i)
{
const auto target_layout = m_swapchain->get_optimal_present_layout();
const auto target_image = m_swapchain->get_image(i);
VkClearColorValue clear_color{};
VkImageSubresourceRange range = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 };
vk::change_image_layout(*m_current_command_buffer, m_swap_chain->get_swap_chain_image(i),
VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL,
range);
vkCmdClearColorImage(*m_current_command_buffer, m_swap_chain->get_swap_chain_image(i), VK_IMAGE_LAYOUT_GENERAL, &clear_color, 1, &range);
vk::change_image_layout(*m_current_command_buffer, m_swap_chain->get_swap_chain_image(i),
VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
range);
vk::change_image_layout(*m_current_command_buffer, target_image, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, range);
vkCmdClearColorImage(*m_current_command_buffer, target_image, VK_IMAGE_LAYOUT_GENERAL, &clear_color, 1, &range);
vk::change_image_layout(*m_current_command_buffer, target_image, VK_IMAGE_LAYOUT_GENERAL, target_layout, range);
}
m_current_frame = &frame_context_storage[0];
m_texture_cache.initialize((*m_device), m_memory_type_mapping, m_optimal_tiling_supported_formats, m_swap_chain->get_present_queue(),
m_texture_cache.initialize((*m_device), m_memory_type_mapping, m_optimal_tiling_supported_formats, m_swapchain->get_graphics_queue(),
m_texture_upload_buffer_ring_info);
m_ui_renderer.reset(new vk::ui_overlay_renderer());
@@ -774,10 +753,8 @@ VKGSRender::~VKGSRender()
m_secondary_command_buffer_pool.destroy();
//Device handles/contexts
m_swap_chain->destroy();
m_swapchain->destroy();
m_thread_context.close();
delete m_swap_chain;
#if !defined(_WIN32) && defined(HAVE_VULKAN)
if (m_display_handle)
@@ -790,7 +767,7 @@ bool VKGSRender::on_access_violation(u32 address, bool is_writing)
vk::texture_cache::thrashed_set result;
{
std::lock_guard<std::mutex> lock(m_secondary_cb_guard);
result = std::move(m_texture_cache.invalidate_address(address, is_writing, false, m_secondary_command_buffer, m_memory_type_mapping, m_swap_chain->get_present_queue()));
result = std::move(m_texture_cache.invalidate_address(address, is_writing, false, m_secondary_command_buffer, m_memory_type_mapping, m_swapchain->get_graphics_queue()));
}
if (!result.violation_handled)
@@ -852,7 +829,7 @@ bool VKGSRender::on_access_violation(u32 address, bool is_writing)
m_flush_requests.producer_wait();
}
m_texture_cache.flush_all(result, m_secondary_command_buffer, m_memory_type_mapping, m_swap_chain->get_present_queue());
m_texture_cache.flush_all(result, m_secondary_command_buffer, m_memory_type_mapping, m_swapchain->get_graphics_queue());
if (has_queue_ref)
{
@@ -868,7 +845,7 @@ void VKGSRender::on_notify_memory_unmapped(u32 address_base, u32 size)
{
std::lock_guard<std::mutex> lock(m_secondary_cb_guard);
if (m_texture_cache.invalidate_range(address_base, size, true, true, false,
m_secondary_command_buffer, m_memory_type_mapping, m_swap_chain->get_present_queue()).violation_handled)
m_secondary_command_buffer, m_memory_type_mapping, m_swapchain->get_graphics_queue()).violation_handled)
{
m_texture_cache.purge_dirty();
{
@@ -1809,7 +1786,7 @@ void VKGSRender::copy_render_targets_to_dma_location()
continue;
m_texture_cache.flush_memory_to_cache(m_surface_info[index].address, m_surface_info[index].pitch * m_surface_info[index].height, true,
*m_current_command_buffer, m_memory_type_mapping, m_swap_chain->get_present_queue());
*m_current_command_buffer, m_memory_type_mapping, m_swapchain->get_graphics_queue());
}
}
@@ -1818,7 +1795,7 @@ void VKGSRender::copy_render_targets_to_dma_location()
if (m_depth_surface_info.pitch)
{
m_texture_cache.flush_memory_to_cache(m_depth_surface_info.address, m_depth_surface_info.pitch * m_depth_surface_info.height, true,
*m_current_command_buffer, m_memory_type_mapping, m_swap_chain->get_present_queue());
*m_current_command_buffer, m_memory_type_mapping, m_swapchain->get_graphics_queue());
}
}
@@ -1927,18 +1904,10 @@ void VKGSRender::advance_queued_frames()
void VKGSRender::present(frame_context_t *ctx)
{
verify(HERE), ctx->present_image != UINT32_MAX;
VkSwapchainKHR swap_chain = (VkSwapchainKHR)(*m_swap_chain);
if (!present_surface_dirty_flag)
{
VkPresentInfoKHR present = {};
present.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
present.pNext = nullptr;
present.swapchainCount = 1;
present.pSwapchains = &swap_chain;
present.pImageIndices = &ctx->present_image;
switch (VkResult error = m_swap_chain->queuePresentKHR(m_swap_chain->get_present_queue(), &present))
switch (VkResult error = m_swapchain->present(ctx->present_image))
{
case VK_SUCCESS:
case VK_SUBOPTIMAL_KHR:
@@ -1968,7 +1937,17 @@ void VKGSRender::queue_swap_request()
}
m_current_frame->swap_command_buffer = m_current_command_buffer;
close_and_submit_command_buffer({ m_current_frame->present_semaphore }, m_current_command_buffer->submit_fence);
if (m_swapchain->is_headless())
{
m_swapchain->end_frame(*m_current_command_buffer, m_current_frame->present_image);
close_and_submit_command_buffer({}, m_current_command_buffer->submit_fence);
}
else
{
close_and_submit_command_buffer({ m_current_frame->present_semaphore }, m_current_command_buffer->submit_fence);
}
m_current_frame->swap_command_buffer->pending = true;
//Grab next cb in line and make it usable
@@ -2462,7 +2441,7 @@ void VKGSRender::close_and_submit_command_buffer(const std::vector<VkSemaphore>
{
m_current_command_buffer->end();
m_current_command_buffer->tag();
m_current_command_buffer->submit(m_swap_chain->get_present_queue(), semaphores, fence, pipeline_stage_flags);
m_current_command_buffer->submit(m_swapchain->get_graphics_queue(), semaphores, fence, pipeline_stage_flags);
}
void VKGSRender::open_command_buffer()
@@ -2654,7 +2633,7 @@ void VKGSRender::prepare_rtts(rsx::framebuffer_creation_context context)
m_texture_cache.set_memory_read_flags(m_surface_info[i].address, m_surface_info[i].pitch * m_surface_info[i].height, rsx::memory_read_flags::flush_once);
m_texture_cache.flush_if_cache_miss_likely(old_format, m_surface_info[i].address, m_surface_info[i].pitch * m_surface_info[i].height,
*m_current_command_buffer, m_memory_type_mapping, m_swap_chain->get_present_queue());
*m_current_command_buffer, m_memory_type_mapping, m_swapchain->get_graphics_queue());
}
m_surface_info[i].address = m_surface_info[i].pitch = 0;
@@ -2670,7 +2649,7 @@ void VKGSRender::prepare_rtts(rsx::framebuffer_creation_context context)
auto old_format = vk::get_compatible_depth_surface_format(m_optimal_tiling_supported_formats, m_depth_surface_info.depth_format);
m_texture_cache.set_memory_read_flags(m_depth_surface_info.address, m_depth_surface_info.pitch * m_depth_surface_info.height, rsx::memory_read_flags::flush_once);
m_texture_cache.flush_if_cache_miss_likely(old_format, m_depth_surface_info.address, m_depth_surface_info.pitch * m_depth_surface_info.height,
*m_current_command_buffer, m_memory_type_mapping, m_swap_chain->get_present_queue());
*m_current_command_buffer, m_memory_type_mapping, m_swapchain->get_graphics_queue());
}
m_depth_surface_info.address = m_depth_surface_info.pitch = 0;
@@ -2847,14 +2826,14 @@ void VKGSRender::reinitialize_swapchain()
present(&ctx);
}
vkQueueWaitIdle(m_swap_chain->get_present_queue());
//Wait for completion
vkDeviceWaitIdle(*m_device);
//Remove any old refs to the old images as they are about to be destroyed
m_framebuffers_to_clean.clear();
//Rebuild swapchain. Old swapchain destruction is handled by the init_swapchain call
if (!m_swap_chain->init_swapchain(new_width, new_height))
if (!m_swapchain->init(new_width, new_height))
{
LOG_WARNING(RSX, "Swapchain initialization failed. Request ignored [%dx%d]", new_width, new_height);
present_surface_dirty_flag = true;
@@ -2869,18 +2848,16 @@ void VKGSRender::reinitialize_swapchain()
//Prepare new swapchain images for use
open_command_buffer();
for (u32 i = 0; i < m_swap_chain->get_swap_image_count(); ++i)
for (u32 i = 0; i < m_swapchain->get_swap_image_count(); ++i)
{
vk::change_image_layout(*m_current_command_buffer, m_swap_chain->get_swap_chain_image(i),
VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL,
{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 });
const auto target_layout = m_swapchain->get_optimal_present_layout();
const auto target_image = m_swapchain->get_image(i);
VkClearColorValue clear_color{};
auto range = vk::get_image_subresource_range(0, 0, 1, 1, VK_IMAGE_ASPECT_COLOR_BIT);
vkCmdClearColorImage(*m_current_command_buffer, m_swap_chain->get_swap_chain_image(i), VK_IMAGE_LAYOUT_GENERAL, &clear_color, 1, &range);
vk::change_image_layout(*m_current_command_buffer, m_swap_chain->get_swap_chain_image(i),
VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 });
VkImageSubresourceRange range = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1};
vk::change_image_layout(*m_current_command_buffer, target_image, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, range);
vkCmdClearColorImage(*m_current_command_buffer, target_image, VK_IMAGE_LAYOUT_GENERAL, &clear_color, 1, &range);
vk::change_image_layout(*m_current_command_buffer, target_image, VK_IMAGE_LAYOUT_GENERAL, target_layout, range);
}
//Will have to block until rendering is completed
@@ -2989,8 +2966,9 @@ void VKGSRender::flip(int buffer)
//Prepare surface for new frame. Set no timeout here so that we wait for the next image if need be
verify(HERE), m_current_frame->present_image == UINT32_MAX;
u64 timeout = m_swap_chain->get_swap_image_count() <= VK_MAX_ASYNC_FRAMES? 0ull: 100000000ull;
while (VkResult status = vkAcquireNextImageKHR((*m_device), (*m_swap_chain), timeout, m_current_frame->present_semaphore, VK_NULL_HANDLE, &m_current_frame->present_image))
u64 timeout = m_swapchain->get_swap_image_count() <= VK_MAX_ASYNC_FRAMES? 0ull: 100000000ull;
while (VkResult status = m_swapchain->acquire_next_swapchain_image(m_current_frame->present_semaphore, timeout, &m_current_frame->present_image))
{
switch (status)
{
@@ -3053,16 +3031,18 @@ void VKGSRender::flip(int buffer)
}
}
VkImage target_image = m_swap_chain->get_swap_chain_image(m_current_frame->present_image);
VkImage target_image = m_swapchain->get_image(m_current_frame->present_image);
const auto present_layout = m_swapchain->get_optimal_present_layout();
if (image_to_flip)
{
VkImageLayout target_layout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
VkImageLayout target_layout = present_layout;
VkImageSubresourceRange range = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 };
if (aspect_ratio.x || aspect_ratio.y)
{
VkClearColorValue clear_black {};
vk::change_image_layout(*m_current_command_buffer, target_image, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, range);
vk::change_image_layout(*m_current_command_buffer, target_image, present_layout, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, range);
vkCmdClearColorImage(*m_current_command_buffer, target_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &clear_black, 1, &range);
target_layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
@@ -3071,9 +3051,9 @@ void VKGSRender::flip(int buffer)
vk::copy_scaled_image(*m_current_command_buffer, image_to_flip->value, target_image, image_to_flip->current_layout, target_layout,
0, 0, image_to_flip->width(), image_to_flip->height(), aspect_ratio.x, aspect_ratio.y, aspect_ratio.width, aspect_ratio.height, 1, VK_IMAGE_ASPECT_COLOR_BIT, false);
if (target_layout != VK_IMAGE_LAYOUT_PRESENT_SRC_KHR)
if (target_layout != present_layout)
{
vk::change_image_layout(*m_current_command_buffer, target_image, target_layout, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, range);
vk::change_image_layout(*m_current_command_buffer, target_image, target_layout, present_layout, range);
}
}
else
@@ -3082,9 +3062,9 @@ void VKGSRender::flip(int buffer)
//TODO: Upload raw bytes from cpu for rendering
VkImageSubresourceRange range = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 };
VkClearColorValue clear_black {};
vk::change_image_layout(*m_current_command_buffer, m_swap_chain->get_swap_chain_image(m_current_frame->present_image), VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, VK_IMAGE_LAYOUT_GENERAL, range);
vkCmdClearColorImage(*m_current_command_buffer, m_swap_chain->get_swap_chain_image(m_current_frame->present_image), VK_IMAGE_LAYOUT_GENERAL, &clear_black, 1, &range);
vk::change_image_layout(*m_current_command_buffer, m_swap_chain->get_swap_chain_image(m_current_frame->present_image), VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, range);
vk::change_image_layout(*m_current_command_buffer, m_swapchain->get_image(m_current_frame->present_image), present_layout, VK_IMAGE_LAYOUT_GENERAL, range);
vkCmdClearColorImage(*m_current_command_buffer, m_swapchain->get_image(m_current_frame->present_image), VK_IMAGE_LAYOUT_GENERAL, &clear_black, 1, &range);
vk::change_image_layout(*m_current_command_buffer, m_swapchain->get_image(m_current_frame->present_image), VK_IMAGE_LAYOUT_GENERAL, present_layout, range);
}
std::unique_ptr<vk::framebuffer_holder> direct_fbo;
@@ -3096,7 +3076,7 @@ void VKGSRender::flip(int buffer)
VkImageMemoryBarrier barrier = {};
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
barrier.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
barrier.oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
barrier.oldLayout = present_layout;
barrier.image = target_image;
barrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
barrier.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
@@ -3106,7 +3086,7 @@ void VKGSRender::flip(int buffer)
vkCmdPipelineBarrier(*m_current_command_buffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_DEPENDENCY_BY_REGION_BIT, 0, nullptr, 0, nullptr, 1, &barrier);
size_t idx = vk::get_render_pass_location(m_swap_chain->get_surface_format(), VK_FORMAT_UNDEFINED, 1);
size_t idx = vk::get_render_pass_location(m_swapchain->get_surface_format(), VK_FORMAT_UNDEFINED, 1);
VkRenderPass single_target_pass = m_render_passes[idx];
for (auto It = m_framebuffers_to_clean.begin(); It != m_framebuffers_to_clean.end(); It++)
@@ -3123,7 +3103,7 @@ void VKGSRender::flip(int buffer)
if (!direct_fbo)
{
swap_image_view.push_back(std::make_unique<vk::image_view>(*m_device, target_image, VK_IMAGE_VIEW_TYPE_2D, m_swap_chain->get_surface_format(), vk::default_component_map(), subres));
swap_image_view.push_back(std::make_unique<vk::image_view>(*m_device, target_image, VK_IMAGE_VIEW_TYPE_2D, m_swapchain->get_surface_format(), vk::default_component_map(), subres));
direct_fbo.reset(new vk::framebuffer_holder(*m_device, single_target_pass, m_client_width, m_client_height, std::move(swap_image_view)));
}
@@ -3152,7 +3132,7 @@ void VKGSRender::flip(int buffer)
m_text_writer->print_text(*m_current_command_buffer, *direct_fbo, 0, 180, direct_fbo->width(), direct_fbo->height(), "Flush requests: " + std::to_string(num_flushes) + " (" + std::to_string(cache_miss_ratio) + "% hard faults)");
}
vk::change_image_layout(*m_current_command_buffer, target_image, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, subres);
vk::change_image_layout(*m_current_command_buffer, target_image, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, present_layout, subres);
m_framebuffers_to_clean.push_back(std::move(direct_fbo));
}
@@ -3217,7 +3197,7 @@ bool VKGSRender::scaled_image_from_memory(rsx::blit_src_info& src, rsx::blit_dst
if (result.dst_image)
{
if (m_texture_cache.flush_if_cache_miss_likely(result.dst_image->info.format, result.real_dst_address, result.real_dst_size,
*m_current_command_buffer, m_memory_type_mapping, m_swap_chain->get_present_queue()))
*m_current_command_buffer, m_memory_type_mapping, m_swapchain->get_graphics_queue()))
require_flush = true;
}
+2 -3
View File
@@ -238,9 +238,7 @@ class VKGSRender : public GSRender
private:
VKFragmentProgram m_fragment_prog;
VKVertexProgram m_vertex_prog;
vk::glsl::program *m_program;
vk::context m_thread_context;
vk::texture_cache m_texture_cache;
rsx::vk_render_targets m_rtts;
@@ -275,8 +273,9 @@ public:
private:
std::unique_ptr<VKProgramBuffer> m_prog_buffer;
std::unique_ptr<vk::swapchain_base> m_swapchain;
vk::context m_thread_context;
vk::render_device *m_device;
vk::swap_chain* m_swap_chain;
//Vulkan internals
vk::command_pool m_command_buffer_pool;
+2 -2
View File
@@ -56,10 +56,10 @@ namespace vk
#endif
}
memory_type_mapping get_memory_mapping(VkPhysicalDevice pdev)
memory_type_mapping get_memory_mapping(const vk::physical_device& dev)
{
VkPhysicalDeviceMemoryProperties memory_properties;
vkGetPhysicalDeviceMemoryProperties(pdev, &memory_properties);
vkGetPhysicalDeviceMemoryProperties((VkPhysicalDevice&)dev, &memory_properties);
memory_type_mapping result;
result.device_local = VK_MAX_MEMORY_TYPES;
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -630,7 +630,7 @@ namespace vk
return upload_simple_texture(cmd.get_command_pool().get_owner(), cmd, memory_types, upload_heap, key, desc->w, desc->h, false, true, desc->data);
}
void update_uniforms(vk::glsl::program *program) override
void update_uniforms(vk::glsl::program* /*program*/) override
{
auto dst = (f32*)m_ubo->map(first_vertex * 128, 128);
dst[0] = m_scale_offset.r;
+2 -2
View File
@@ -40,14 +40,14 @@ if(EXISTS ${GIT_VERSION_FILE})
# Don't update if marked not to update.
file(STRINGS ${GIT_VERSION_FILE} match
REGEX "RPCS3_GIT_VERSION_NO_UPDATE 1")
if(NOT ${match} EQUAL "")
if(NOT "${match}" EQUAL "")
set(GIT_VERSION_UPDATE "0")
endif()
# Don't update if it's already the same.
file(STRINGS ${GIT_VERSION_FILE} match
REGEX "${GIT_VERSION}")
if(NOT ${match} EQUAL "")
if(NOT "${match}" EQUAL "")
set(GIT_VERSION_UPDATE "0")
endif()
endif()
+1
View File
@@ -86,6 +86,7 @@ int main(int argc, char** argv)
#endif
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QCoreApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton);
s_init.post();
s_qt_mutex.wait();
+1 -1
View File
@@ -195,7 +195,7 @@
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<AdditionalDependencies>..\hidapi.lib;winmm.lib;OpenAL.lib;XAudio.lib;D3D12GSRender.lib;GLGSRender.lib;shlwapi.lib;VKGSRender.lib;VKstatic.1.lib;glslang.lib;OSDependent.lib;OGLCompiler.lib;SPIRV.lib;HLSL.lib;Advapi32.lib;user32.lib;zlib.lib;..\libpng.lib;asmjit.lib;yaml-cpp.lib;emucore.lib;dxgi.lib;$(QTDIR)\lib\qtmain.lib;shell32.lib;opengl32.lib;$(QTDIR)\lib\Qt5OpenGL.lib;$(QTDIR)\lib\Qt5Widgets.lib;$(QTDIR)\lib\Qt5Quick.lib;$(QTDIR)\lib\Qt5Gui.lib;$(QTDIR)\lib\Qt5Qml.lib;$(QTDIR)\lib\Qt5Network.lib;$(QTDIR)\lib\Qt5Core.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5WinExtras.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>gdi32.lib;..\hidapi.lib;winmm.lib;OpenAL.lib;XAudio.lib;D3D12GSRender.lib;GLGSRender.lib;shlwapi.lib;VKGSRender.lib;VKstatic.1.lib;glslang.lib;OSDependent.lib;OGLCompiler.lib;SPIRV.lib;HLSL.lib;Advapi32.lib;user32.lib;zlib.lib;..\libpng.lib;asmjit.lib;yaml-cpp.lib;emucore.lib;dxgi.lib;$(QTDIR)\lib\qtmain.lib;shell32.lib;opengl32.lib;$(QTDIR)\lib\Qt5OpenGL.lib;$(QTDIR)\lib\Qt5Widgets.lib;$(QTDIR)\lib\Qt5Quick.lib;$(QTDIR)\lib\Qt5Gui.lib;$(QTDIR)\lib\Qt5Qml.lib;$(QTDIR)\lib\Qt5Network.lib;$(QTDIR)\lib\Qt5Core.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5WinExtras.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\3rdparty\OpenAL\libs\Win64;..\Vulkan\glslang-build\hlsl\Release;..\Vulkan\glslang-build\SPIRV\Release;..\Vulkan\glslang-build\OGLCompilersDLL\Release;..\Vulkan\glslang-build\glslang\OSDependent\Windows\Release;..\Vulkan\Vulkan-build\loader\Release;..\Vulkan\glslang-build\glslang\Release;..\lib\$(CONFIGURATION)-$(PLATFORM);..\3rdparty\minidx12\Lib;$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention>
-1
View File
@@ -23,7 +23,6 @@ about_dialog::about_dialog(QWidget* parent) : QDialog(parent), ui(new Ui::about_
connect(ui->patreon, &QAbstractButton::clicked, [] { QDesktopServices::openUrl(QUrl("https://www.patreon.com/Nekotekina")); });
connect(ui->close, &QAbstractButton::clicked, this, &QWidget::close);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
layout()->setSizeConstraint(QLayout::SetFixedSize);
}
@@ -5,8 +5,6 @@ constexpr auto qstr = QString::fromStdString;
auto_pause_settings_dialog::auto_pause_settings_dialog(QWidget *parent) : QDialog(parent)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QLabel *description = new QLabel(tr("To use auto pause: enter the ID(s) of a function or a system call.\nRestart of the game is required to apply. You can enable/disable this in the settings."), this);
pauseList = new QTableWidget(this);
-1
View File
@@ -5,7 +5,6 @@
find_dialog::find_dialog(QTextEdit* edit, QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f), m_text_edit(edit)
{
setWindowTitle(tr("Find string"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_find_bar = new QLineEdit();
m_find_bar->setPlaceholderText(tr("Search..."));
@@ -76,7 +76,6 @@ gamepads_settings_dialog::gamepads_settings_dialog(QWidget* parent)
json_file.open(QIODevice::ReadOnly | QIODevice::Text);
QJsonObject json_input = QJsonDocument::fromJson(json_file.readAll()).object().value("input").toObject();
json_file.close();
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QVBoxLayout *dialog_layout = new QVBoxLayout();
QHBoxLayout *all_players = new QHBoxLayout();
-1
View File
@@ -260,7 +260,6 @@ void gui_settings::ShowInfoBox(const gui_save& entry, const QString& title, cons
{
QCheckBox* cb = new QCheckBox(tr("Don't show again"));
QMessageBox* mb = new QMessageBox(QMessageBox::Information, title, text, QMessageBox::Ok, parent);
mb->setWindowFlags(mb->windowFlags() & ~Qt::WindowContextHelpButtonHint);
mb->setCheckBox(cb);
mb->deleteLater();
mb->exec();
@@ -14,7 +14,6 @@ instruction_editor_dialog::instruction_editor_dialog(QWidget *parent, u32 _pc, c
{
setWindowTitle(tr("Edit instruction"));
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setMinimumSize(300, sizeHint().height());
const auto cpu = _cpu.get();
-1
View File
@@ -30,7 +30,6 @@ kernel_explorer::kernel_explorer(QWidget* parent) : QDialog(parent)
setWindowTitle(tr("Kernel Explorer"));
setObjectName("kernel_explorer");
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setMinimumSize(QSize(700, 450));
QVBoxLayout* vbox_panel = new QVBoxLayout();
-1
View File
@@ -8,7 +8,6 @@ memory_string_searcher::memory_string_searcher(QWidget* parent)
{
setWindowTitle(tr("String Searcher"));
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_addr_line = new QLineEdit(this);
m_addr_line->setFixedWidth(QLabel("This is the very length of the lineedit due to hidpi reasons.").sizeHint().width());
-1
View File
@@ -11,7 +11,6 @@ memory_viewer_panel::memory_viewer_panel(QWidget* parent)
setWindowTitle(tr("Memory Viewer"));
setObjectName("memory_viewer");
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
exit = false;
m_addr = 0;
m_colcount = 16;
-2
View File
@@ -24,7 +24,6 @@ void msg_dialog_frame::Create(const std::string& msg)
m_dialog = new custom_dialog(type.disable_cancel);
m_dialog->setWindowTitle(type.se_normal ? "Normal dialog" : "Error dialog");
m_dialog->setWindowFlags(m_dialog->windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_dialog->setWindowOpacity(type.bg_invisible ? 1. : 0.75);
m_text = new QLabel(qstr(msg));
@@ -246,7 +245,6 @@ void msg_dialog_frame::CreateOsk(const std::string& msg, char16_t* osk_text, u32
//Title
m_osk_dialog->setWindowTitle(qstr(msg));
m_osk_dialog->setWindowFlags(m_osk_dialog->windowFlags() & ~Qt::WindowContextHelpButtonHint);
//Text Input
QLineEdit* input = new QLineEdit(m_osk_dialog);
-2
View File
@@ -18,8 +18,6 @@ pad_settings_dialog::pad_settings_dialog(const std::string& device, const std::s
{
ui->setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
ui->b_cancel->setDefault(true);
connect(ui->b_cancel, &QAbstractButton::clicked, this, &QWidget::close);
-1
View File
@@ -13,7 +13,6 @@ register_editor_dialog::register_editor_dialog(QWidget *parent, u32 _pc, const s
{
setWindowTitle(tr("Edit registers"));
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QVBoxLayout* vbox_panel = new QVBoxLayout();
QHBoxLayout* hbox_panel = new QHBoxLayout();
-1
View File
@@ -18,7 +18,6 @@ rsx_debugger::rsx_debugger(QWidget* parent)
{
setWindowTitle(tr("RSX Debugger"));
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
//Fonts and Colors
QFont mono = QFontDatabase::systemFont(QFontDatabase::FixedFont);
-1
View File
@@ -9,7 +9,6 @@ constexpr auto qstr = QString::fromStdString;
save_data_info_dialog::save_data_info_dialog(const SaveDataEntry& save, QWidget* parent)
: QDialog(parent), m_entry(save)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Save Data Information"));
// Table
-2
View File
@@ -16,8 +16,6 @@ constexpr auto qstr = QString::fromStdString;
save_data_list_dialog::save_data_list_dialog(const std::vector<SaveDataEntry>& entries, s32 focusedEntry, u32 op, vm::ptr<CellSaveDataListSet> listSet, QWidget* parent)
: QDialog(parent), m_save_entries(entries), m_entry(selection_code::new_save), m_entry_label(nullptr)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
if (op >= 8)
{
setWindowTitle(tr("Save Data Interface (Delete)"));
+4 -5
View File
@@ -81,7 +81,6 @@ namespace
save_manager_dialog::save_manager_dialog(std::shared_ptr<gui_settings> gui_settings, std::string dir, QWidget* parent)
: QDialog(parent), m_save_entries(), m_dir(dir), m_sort_column(1), m_sort_ascending(true), m_gui_settings(gui_settings)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Save Manager"));
setMinimumSize(QSize(400, 400));
@@ -249,7 +248,7 @@ void save_manager_dialog::OnEntryRemove()
if (idx != -1)
{
int idx_real = m_list->item(idx, 0)->data(Qt::UserRole).toInt();
if (QMessageBox::question(this, "Delete Confirmation", "Are you sure you want to delete:\n" + qstr(m_save_entries[idx_real].title) + "?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
if (QMessageBox::question(this, tr("Delete Confirmation"), tr("Are you sure you want to delete:\n%1?").arg(qstr(m_save_entries[idx_real].title)), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
{
fs::remove_all(m_dir + m_save_entries[idx_real].dirName + "/");
m_list->removeRow(idx);
@@ -271,8 +270,7 @@ void save_manager_dialog::OnEntriesRemove()
return;
}
if (QMessageBox::question(this, "Delete Confirmation", QString("Are you sure you want to delete these %1 items?").arg(selection.size())
, QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
if (QMessageBox::question(this, tr("Delete Confirmation"), tr("Are you sure you want to delete these %1 items?").arg(selection.size()), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
{
qSort(selection.begin(), selection.end(), qGreater<QModelIndex>());
for (QModelIndex index : selection)
@@ -325,7 +323,8 @@ void save_manager_dialog::ShowContextMenu(const QPoint &pos)
// Events
connect(removeAct, &QAction::triggered, this, &save_manager_dialog::OnEntriesRemove); // entriesremove handles case of one as well
connect(infoAct, &QAction::triggered, this, &save_manager_dialog::OnEntryInfo);
connect(showDirAct, &QAction::triggered, [=]() {
connect(showDirAct, &QAction::triggered, [=]()
{
int idx_real = m_list->item(idx, 0)->data(Qt::UserRole).toInt();
QString path = qstr(m_dir + m_save_entries[idx_real].dirName + "/");
QDesktopServices::openUrl(QUrl("file:///" + path));
-2
View File
@@ -30,8 +30,6 @@ inline std::string sstr(const QVariant& _in) { return sstr(_in.toString()); }
settings_dialog::settings_dialog(std::shared_ptr<gui_settings> guiSettings, std::shared_ptr<emu_settings> emuSettings, const int& tabIndex, QWidget *parent, const GameInfo* game)
: QDialog(parent), xgui_settings(guiSettings), xemu_settings(emuSettings), ui(new Ui::settings_dialog), m_tab_Index(tabIndex)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
ui->setupUi(this);
ui->cancelButton->setFocus();
ui->tabWidget->setUsesScrollButtons(false);
-1
View File
@@ -40,7 +40,6 @@ trophy_manager_dialog::trophy_manager_dialog(std::shared_ptr<gui_settings> gui_s
: QWidget(), m_sort_column(0), m_col_sort_order(Qt::AscendingOrder), m_gui_settings(gui_settings)
{
// Nonspecific widget settings
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Trophy Manager"));
m_icon_height = m_gui_settings->GetValue(gui::tr_icon_height).toInt();
+3 -8
View File
@@ -1,10 +1,5 @@
#include "vfs_dialog.h"
#include "Emu/System.h"
#include "vfs_dialog_tab.h"
#include <QVBoxLayout>
#include <QPushButton>
inline std::string sstr(const QString& _in) { return _in.toStdString(); }
@@ -69,8 +64,9 @@ vfs_dialog::vfs_dialog(std::shared_ptr<gui_settings> guiSettings, std::shared_pt
{
for (int i = 0; i < tabs->count(); ++i)
{
static_cast<vfs_dialog_tab*>(tabs->widget(i))->SaveSettings();
static_cast<vfs_dialog_tab*>(tabs->widget(i))->SetSettings();
}
m_emu_settings->SaveSettings();
accept();
});
@@ -86,6 +82,5 @@ vfs_dialog::vfs_dialog(std::shared_ptr<gui_settings> guiSettings, std::shared_pt
vbox->addLayout(buttons);
setLayout(vbox);
setWindowTitle("Virtual File System");
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Virtual File System"));
}
+1 -2
View File
@@ -1,7 +1,6 @@
#pragma once
#include "gui_settings.h"
#include "emu_settings.h"
#include "vfs_dialog_tab.h"
#include <QTabWidget>
#include <QDialog>
+24 -47
View File
@@ -2,8 +2,6 @@
#include <QFileDialog>
#include <QCoreApplication>
#include <QHBoxLayout>
#include <QVBoxLayout>
inline std::string sstr(const QString& _in) { return _in.toStdString(); }
@@ -13,27 +11,29 @@ vfs_dialog_tab::vfs_dialog_tab(const vfs_settings_info& settingsInfo, std::share
m_dirList = new QListWidget(this);
QStringList alldirs = m_gui_settings->GetValue(m_info.listLocation).toStringList();
const QString current_dir = qstr(m_info.cfg_node->to_string());
QListWidgetItem* selected_item = nullptr;
// We must show the currently selected config.
if (alldirs.contains(EmuConfigDir()) == false)
{
new QListWidgetItem(EmuConfigDir(), m_dirList);
}
for (const QString& dir : alldirs)
{
new QListWidgetItem(dir, m_dirList);
QListWidgetItem* item = new QListWidgetItem(dir, m_dirList);
if (dir == current_dir)
selected_item = item;
}
// We must show the currently selected config.
if (!selected_item)
selected_item = new QListWidgetItem(current_dir, m_dirList);
selected_item->setSelected(true);
m_dirList->setMinimumWidth(m_dirList->sizeHintForColumn(0));
QHBoxLayout* selectedConfigLayout = new QHBoxLayout;
QLabel* selectedMessage = new QLabel(m_info.name + " directory:");
m_selectedConfigLabel = new QLabel();
m_selectedConfigLabel->setText(EmuConfigDir());
if (m_selectedConfigLabel->text() == "")
{
m_selectedConfigLabel->setText(EmptyPath);
}
m_selectedConfigLabel->setText(current_dir.isEmpty() ? EmptyPath : current_dir);
selectedConfigLayout->addWidget(selectedMessage);
selectedConfigLayout->addWidget(m_selectedConfigLabel);
selectedConfigLayout->addStretch();
@@ -44,52 +44,34 @@ vfs_dialog_tab::vfs_dialog_tab(const vfs_settings_info& settingsInfo, std::share
setLayout(vbox);
connect(m_dirList, &QListWidget::itemDoubleClicked, [this](QListWidgetItem* item)
connect(m_dirList, &QListWidget::currentItemChanged, [this](QListWidgetItem* current, QListWidgetItem*)
{
if (item->text() == "")
{
m_selectedConfigLabel->setText(EmptyPath);
}
else
{
m_selectedConfigLabel->setText(item->text());
}
m_selectedConfigLabel->setText(current->text().isEmpty() ? EmptyPath : current->text());
});
}
void vfs_dialog_tab::SaveSettings()
void vfs_dialog_tab::SetSettings()
{
QStringList allDirs;
for (int i = 0; i < m_dirList->count(); ++i)
{
allDirs += m_dirList->item(i)->text();
}
m_gui_settings->SetValue(m_info.listLocation, allDirs);
if (m_selectedConfigLabel->text() == EmptyPath)
{
m_info.cfg_node->from_string("");
m_emu_settings->SetSetting(m_info.settingLoc, "");
}
else
{
m_info.cfg_node->from_string(sstr(m_selectedConfigLabel->text()));
m_emu_settings->SetSetting(m_info.settingLoc, sstr(m_selectedConfigLabel->text()));
}
m_emu_settings->SaveSettings();
const std::string new_dir = m_selectedConfigLabel->text() == EmptyPath ? "" : sstr(m_selectedConfigLabel->text());
m_info.cfg_node->from_string(new_dir);
m_emu_settings->SetSetting(m_info.settingLoc, new_dir);
}
void vfs_dialog_tab::Reset()
{
const QString current_dir = qstr(m_info.cfg_node->to_string());
m_dirList->clear();
m_info.cfg_node->from_default();
m_selectedConfigLabel->setText(EmuConfigDir());
if (m_selectedConfigLabel->text() == "")
{
m_selectedConfigLabel->setText(EmptyPath);
}
m_dirList->addItem(new QListWidgetItem(EmuConfigDir()));
m_gui_settings->SetValue(m_info.listLocation, QStringList(EmuConfigDir()));
m_selectedConfigLabel->setText(current_dir.isEmpty() ? EmptyPath : current_dir);
m_dirList->addItem(new QListWidgetItem(current_dir));
m_gui_settings->SetValue(m_info.listLocation, QStringList(current_dir));
}
void vfs_dialog_tab::AddNewDirectory()
@@ -102,8 +84,3 @@ void vfs_dialog_tab::AddNewDirectory()
m_selectedConfigLabel->setText(dir);
}
}
QString vfs_dialog_tab::EmuConfigDir()
{
return qstr(m_info.cfg_node->to_string());
}
+3 -5
View File
@@ -6,7 +6,7 @@
#include "gui_settings.h"
#include "emu_settings.h"
#include <QWidget>
#include <QHBoxLayout>
#include <QListWidget>
#include <QLabel>
@@ -25,13 +25,11 @@ class vfs_dialog_tab : public QWidget
public:
explicit vfs_dialog_tab(const vfs_settings_info& info, std::shared_ptr<gui_settings> guiSettings, std::shared_ptr<emu_settings> emuSettings, QWidget* parent = nullptr);
void SaveSettings();
void SetSettings();
void AddNewDirectory();
void Reset();
private:
QString EmuConfigDir();
const QString EmptyPath = "Empty Path";
const QString EmptyPath = tr("Empty Path");
vfs_settings_info m_info;
std::shared_ptr<gui_settings> m_gui_settings;
+1 -1
View File
@@ -15,7 +15,7 @@ welcome_dialog::welcome_dialog(QWidget* parent) : QDialog(parent), ui(new Ui::we
{
ui->setupUi(this);
setWindowFlags(windowFlags() & Qt::WindowTitleHint & ~Qt::WindowContextHelpButtonHint);
setWindowFlags(windowFlags() & Qt::WindowTitleHint);
gui_settings* settings = new gui_settings(this);