mirror of https://github.com/InoriRus/Kyty.git
add launcher
This commit is contained in:
parent
bdbacbe7ad
commit
8ee51a2756
|
@ -26,8 +26,12 @@ gcc (MinGW-W64 x86_64-posix-seh)|10.2.0
|
|||
ninja |1.10.1
|
||||
MinGW-w64 |8.0.0
|
||||
Eclipse CDT |10.3.0
|
||||
Qt |5.15.0
|
||||
|
||||
Define environment variable named Qt5_DIR pointing to the proper version of Qt
|
||||
|
||||
MSVC compiler (cl.exe) is not supported!
|
||||
|
||||
External dependencies:
|
||||
* Vulkan SDK 1.2.176.1
|
||||
* Qt 5.15.0
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
@ECHO OFF
|
||||
|
||||
if not !%1==! goto :with_arg
|
||||
|
||||
ECHO 1.Debug
|
||||
ECHO 2.Debug Final
|
||||
ECHO 3.Release
|
||||
|
@ -9,32 +11,50 @@ ECHO.
|
|||
|
||||
CHOICE /C 12345 /M "Enter your choice:"
|
||||
|
||||
IF %errorlevel% EQU 5 goto :End
|
||||
goto :without_arg
|
||||
|
||||
:with_arg
|
||||
set CH=%1
|
||||
goto :Start
|
||||
:without_arg
|
||||
set CH=%errorlevel%
|
||||
:Start
|
||||
|
||||
@ECHO ON
|
||||
|
||||
GOTO choice-%errorlevel%
|
||||
GOTO choice-%CH%
|
||||
|
||||
:choice-1
|
||||
mkdir _DebugEclipseMinGW
|
||||
cd _DebugEclipseMinGW
|
||||
cmake -G "Eclipse CDT4 - MinGW Makefiles" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -D CMAKE_BUILD_TYPE=Debug ../../source
|
||||
echo mingw32-make.exe >_build.bat
|
||||
echo mingw32-make.exe install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - MinGW Makefiles" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=_bin ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-2
|
||||
mkdir _DebugFinalEclipseMinGW
|
||||
cd _DebugFinalEclipseMinGW
|
||||
cmake -G "Eclipse CDT4 - MinGW Makefiles" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -D CMAKE_BUILD_TYPE=Debug -D KYTY_FINAL=1 ../../source
|
||||
echo mingw32-make.exe >_build.bat
|
||||
echo mingw32-make.exe install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - MinGW Makefiles" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Debug -D KYTY_FINAL=1 -D CMAKE_INSTALL_PREFIX=_bin ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-3
|
||||
mkdir _ReleaseEclipseMinGW
|
||||
cd _ReleaseEclipseMinGW
|
||||
cmake -G "Eclipse CDT4 - MinGW Makefiles" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -D CMAKE_BUILD_TYPE=Release ../../source
|
||||
echo mingw32-make.exe >_build.bat
|
||||
echo mingw32-make.exe install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - MinGW Makefiles" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=_bin ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-4
|
||||
mkdir _ReleaseFinalEclipseMinGW
|
||||
cd _ReleaseFinalEclipseMinGW
|
||||
cmake -G "Eclipse CDT4 - MinGW Makefiles" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -D CMAKE_BUILD_TYPE=Release -D KYTY_FINAL=1 ../../source
|
||||
echo mingw32-make.exe >_build.bat
|
||||
echo mingw32-make.exe install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - MinGW Makefiles" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Release -D KYTY_FINAL=1 -D CMAKE_INSTALL_PREFIX=_bin ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-5
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
@ECHO OFF
|
||||
|
||||
if not !%1==! goto :with_arg
|
||||
|
||||
ECHO 1.Debug
|
||||
ECHO 2.Debug Final
|
||||
ECHO 3.Release
|
||||
|
@ -9,31 +11,49 @@ ECHO.
|
|||
|
||||
CHOICE /C 12345 /M "Enter your choice:"
|
||||
|
||||
IF %errorlevel% EQU 5 goto :End
|
||||
goto :without_arg
|
||||
|
||||
:with_arg
|
||||
set CH=%1
|
||||
goto :Start
|
||||
:without_arg
|
||||
set CH=%errorlevel%
|
||||
:Start
|
||||
|
||||
@ECHO ON
|
||||
|
||||
GOTO choice-%errorlevel%
|
||||
GOTO choice-%CH%
|
||||
|
||||
:choice-1
|
||||
mkdir _DebugEclipseMinGWClang
|
||||
cd _DebugEclipseMinGWClang
|
||||
echo mingw32-make.exe >_build.bat
|
||||
echo mingw32-make.exe install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - MinGW Makefiles" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Debug ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-2
|
||||
mkdir _DebugFinalEclipseMinGWClang
|
||||
cd _DebugFinalEclipseMinGWClang
|
||||
echo mingw32-make.exe >_build.bat
|
||||
echo mingw32-make.exe install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - MinGW Makefiles" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Debug -D KYTY_FINAL=1 ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-3
|
||||
mkdir _ReleaseEclipseMinGWClang
|
||||
cd _ReleaseEclipseMinGWClang
|
||||
echo mingw32-make.exe >_build.bat
|
||||
echo mingw32-make.exe install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - MinGW Makefiles" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Release ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-4
|
||||
mkdir _ReleaseFinalEclipseMinGWClang
|
||||
cd _ReleaseFinalEclipseMinGWClang
|
||||
echo mingw32-make.exe >_build.bat
|
||||
echo mingw32-make.exe install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - MinGW Makefiles" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Release -D KYTY_FINAL=1 ../../source
|
||||
GOTO End
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
@ECHO OFF
|
||||
|
||||
if not !%1==! goto :with_arg
|
||||
|
||||
ECHO 1.Debug
|
||||
ECHO 2.Debug Final
|
||||
ECHO 3.Release
|
||||
|
@ -9,31 +11,49 @@ ECHO.
|
|||
|
||||
CHOICE /C 12345 /M "Enter your choice:"
|
||||
|
||||
IF %errorlevel% EQU 5 goto :End
|
||||
goto :without_arg
|
||||
|
||||
:with_arg
|
||||
set CH=%1
|
||||
goto :Start
|
||||
:without_arg
|
||||
set CH=%errorlevel%
|
||||
:Start
|
||||
|
||||
@ECHO ON
|
||||
|
||||
GOTO choice-%errorlevel%
|
||||
GOTO choice-%CH%
|
||||
|
||||
:choice-1
|
||||
mkdir _DebugEclipseNinja
|
||||
cd _DebugEclipseNinja
|
||||
echo ninja >_build.bat
|
||||
echo ninja install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - Ninja" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Debug ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-2
|
||||
mkdir _DebugFinalEclipseNinja
|
||||
cd _DebugFinalEclipseNinja
|
||||
echo ninja >_build.bat
|
||||
echo ninja install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - Ninja" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Debug -D KYTY_FINAL=1 ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-3
|
||||
mkdir _ReleaseEclipseNinja
|
||||
cd _ReleaseEclipseNinja
|
||||
echo ninja >_build.bat
|
||||
echo ninja install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - Ninja" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Release ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-4
|
||||
mkdir _ReleaseFinalEclipseNinja
|
||||
cd _ReleaseFinalEclipseNinja
|
||||
echo ninja >_build.bat
|
||||
echo ninja install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - Ninja" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Release -D KYTY_FINAL=1 ../../source
|
||||
GOTO End
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
@ECHO OFF
|
||||
|
||||
if not !%1==! goto :with_arg
|
||||
|
||||
ECHO 1.Debug
|
||||
ECHO 2.Debug Final
|
||||
ECHO 3.Release
|
||||
|
@ -9,32 +11,50 @@ ECHO.
|
|||
|
||||
CHOICE /C 12345 /M "Enter your choice:"
|
||||
|
||||
IF %errorlevel% EQU 5 goto :End
|
||||
goto :without_arg
|
||||
|
||||
:with_arg
|
||||
set CH=%1
|
||||
goto :Start
|
||||
:without_arg
|
||||
set CH=%errorlevel%
|
||||
:Start
|
||||
|
||||
@ECHO ON
|
||||
|
||||
GOTO choice-%errorlevel%
|
||||
GOTO choice-%CH%
|
||||
|
||||
:choice-1
|
||||
mkdir _DebugEclipseNinjaClang
|
||||
cd _DebugEclipseNinjaClang
|
||||
cmake -G "Eclipse CDT4 - Ninja" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Debug ../../source
|
||||
echo ninja >_build.bat
|
||||
echo ninja install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - Ninja" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=_bin ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-2
|
||||
mkdir _DebugFinalEclipseNinjaClang
|
||||
cd _DebugFinalEclipseNinjaClang
|
||||
cmake -G "Eclipse CDT4 - Ninja" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Debug -D KYTY_FINAL=1 ../../source
|
||||
echo ninja >_build.bat
|
||||
echo ninja install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - Ninja" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Debug -D KYTY_FINAL=1 -D CMAKE_INSTALL_PREFIX=_bin ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-3
|
||||
mkdir _ReleaseEclipseNinjaClang
|
||||
cd _ReleaseEclipseNinjaClang
|
||||
cmake -G "Eclipse CDT4 - Ninja" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Release ../../source
|
||||
echo ninja >_build.bat
|
||||
echo ninja install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - Ninja" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=_bin ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-4
|
||||
mkdir _ReleaseFinalEclipseNinjaClang
|
||||
cd _ReleaseFinalEclipseNinjaClang
|
||||
cmake -G "Eclipse CDT4 - Ninja" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Release -D KYTY_FINAL=1 ../../source
|
||||
echo ninja >_build.bat
|
||||
echo ninja install/strip >>_build.bat
|
||||
cmake -G "Eclipse CDT4 - Ninja" -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Release -D KYTY_FINAL=1 -D CMAKE_INSTALL_PREFIX=_bin ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-5
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
@ECHO OFF
|
||||
|
||||
if not !%1==! goto :with_arg
|
||||
|
||||
ECHO 1.Debug
|
||||
ECHO 2.Debug Final
|
||||
ECHO 3.Release
|
||||
ECHO 4.Release Final
|
||||
ECHO 5.Exit
|
||||
ECHO.
|
||||
|
||||
CHOICE /C 12345 /M "Enter your choice:"
|
||||
|
||||
IF %errorlevel% EQU 5 goto :End
|
||||
goto :without_arg
|
||||
|
||||
:with_arg
|
||||
set CH=%1
|
||||
goto :Start
|
||||
:without_arg
|
||||
set CH=%errorlevel%
|
||||
:Start
|
||||
|
||||
set MSVC=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community
|
||||
set PATH=C:\Windows\system32;C:\Windows;%MSVC%\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd;
|
||||
set VCVARSALL="%MSVC%/VC/Auxiliary/Build/vcvarsall.bat"
|
||||
call %VCVARSALL% x64
|
||||
set CFLAGS=-m64 -fdiagnostics-absolute-paths
|
||||
set CXXFLAGS=-m64 -fdiagnostics-absolute-paths
|
||||
|
||||
rem @ECHO ON
|
||||
|
||||
GOTO choice-%CH%
|
||||
|
||||
:choice-1
|
||||
mkdir _DebugMsvc2019NinjaClang
|
||||
cd _DebugMsvc2019NinjaClang
|
||||
set >env.txt
|
||||
echo call %VCVARSALL% x64 >_build.bat
|
||||
echo ninja >>_build.bat
|
||||
echo ninja install >>_build.bat
|
||||
where cmake.exe >cmake.txt
|
||||
cmake -G "Ninja" -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=_bin ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-2
|
||||
mkdir _DebugFinalMsvc2019NinjaClang
|
||||
cd _DebugFinalMsvc2019NinjaClang
|
||||
set >env.txt
|
||||
echo call %VCVARSALL% x64 >_build.bat
|
||||
echo ninja >>_build.bat
|
||||
echo ninja install >>_build.bat
|
||||
where cmake.exe >cmake.txt
|
||||
cmake -G "Ninja" -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -D CMAKE_BUILD_TYPE=Debug -D KYTY_FINAL=1 -D CMAKE_INSTALL_PREFIX=_bin ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-3
|
||||
mkdir _ReleaseMsvc2019NinjaClang
|
||||
cd _ReleaseMsvc2019NinjaClang
|
||||
set >env.txt
|
||||
echo call %VCVARSALL% x64 >_build.bat
|
||||
echo ninja >>_build.bat
|
||||
echo ninja install >>_build.bat
|
||||
where cmake.exe >cmake.txt
|
||||
cmake -G "Ninja" -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=_bin ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-4
|
||||
mkdir _ReleaseFinalMsvc2019NinjaClang
|
||||
cd _ReleaseFinalMsvc2019NinjaClang
|
||||
set >env.txt
|
||||
echo call %VCVARSALL% x64 >_build.bat
|
||||
echo ninja >>_build.bat
|
||||
echo ninja install >>_build.bat
|
||||
where cmake.exe >cmake.txt
|
||||
cmake -G "Ninja" -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -D CMAKE_BUILD_TYPE=Release -D KYTY_FINAL=1 -D CMAKE_INSTALL_PREFIX=_bin ../../source
|
||||
GOTO End
|
||||
|
||||
:choice-5
|
||||
:End
|
|
@ -0,0 +1,5 @@
|
|||
set MSVC=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community
|
||||
set PATH=C:\Windows\system32;C:\Windows;%MSVC%\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd;
|
||||
set VCVARSALL="%MSVC%/VC/Auxiliary/Build/vcvarsall.bat"
|
||||
call %VCVARSALL% x64
|
||||
start "" "%MSVC%\Common7\IDE\devenv.exe" ../source
|
BIN
__bin/fc_script.exe (Stored with Git LFS)
BIN
__bin/fc_script.exe (Stored with Git LFS)
Binary file not shown.
|
@ -92,10 +92,18 @@ IncludeCategories:
|
|||
Priority: 4
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '^<'
|
||||
- Regex: '^<Q'
|
||||
Priority: 5
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '"ui_'
|
||||
Priority: 6
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '^<'
|
||||
Priority: 7
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '.*'
|
||||
Priority: 3
|
||||
SortPriority: 0
|
||||
|
|
Binary file not shown.
|
@ -99,10 +99,13 @@ configure_file(
|
|||
${PROJECT_BINARY_DIR}/cmake_config.h
|
||||
)
|
||||
|
||||
find_package(Git)
|
||||
|
||||
add_custom_target( KytyGitVersion
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D INPUT_FILE=${CMAKE_CURRENT_SOURCE_DIR}/KytyGitVersion.h.in
|
||||
-D OUTPUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/KytyGitVersion.h
|
||||
-D GIT_EXECUTABLE=${GIT_EXECUTABLE}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/generate_version.cmake
|
||||
COMMENT "Generate KytyGitVersion.h"
|
||||
)
|
||||
|
@ -113,6 +116,7 @@ list(APPEND KYTY_IWYU
|
|||
#math_obj
|
||||
#scripts_obj
|
||||
#sys_obj
|
||||
launcher
|
||||
)
|
||||
|
||||
list(APPEND KYTY_CLANG_TYDY
|
||||
|
@ -122,6 +126,7 @@ list(APPEND KYTY_CLANG_TYDY
|
|||
#math_obj
|
||||
#scripts_obj
|
||||
#sys_obj
|
||||
launcher
|
||||
)
|
||||
|
||||
set(KYTY_LIB_HEADERS ${PROJECT_SOURCE_DIR}/include)
|
||||
|
@ -130,6 +135,7 @@ config_compiler_and_linker()
|
|||
|
||||
add_subdirectory(3rdparty)
|
||||
add_subdirectory(emulator)
|
||||
add_subdirectory(launcher)
|
||||
add_subdirectory(lib)
|
||||
|
||||
add_executable(fc_script ${KYTY_SCRIPT_SRC})
|
||||
|
@ -167,9 +173,11 @@ if(MSVC)
|
|||
LINK_FLAGS "/DYNAMICBASE:NO /MAP:fc_script_msvc_${KYTY_BITNESS}.map"
|
||||
)
|
||||
add_custom_command(TARGET fc_script POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different fc_script_msvc_${KYTY_BITNESS}.map $<TARGET_FILE_DIR:fc_script>/fc_script_msvc_${KYTY_LINKER_ID}_${KYTY_BITNESS}.map)
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different fc_script_msvc_${KYTY_BITNESS}.map $<TARGET_FILE_DIR:fc_script>/fc_script_${KYTY_COMPILER_ID}_${KYTY_LINKER_ID}_${KYTY_BITNESS}.map)
|
||||
add_custom_command(TARGET fc_script POST_BUILD
|
||||
COMMAND ${KYTY_SCRIPT_BIN} ${PROJECT_SOURCE_DIR}/map_to_csv.lua $<TARGET_FILE_DIR:fc_script>/fc_script msvc ${KYTY_BITNESS} ${KYTY_LINKER_ID})
|
||||
COMMAND ${KYTY_SCRIPT_BIN} ${PROJECT_SOURCE_DIR}/map_to_csv.lua $<TARGET_FILE_DIR:fc_script>/fc_script ${KYTY_COMPILER_ID} ${KYTY_BITNESS} ${KYTY_LINKER_ID})
|
||||
add_custom_command(TARGET fc_script POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PROJECT_SOURCE_DIR}/3rdparty/winpthread/bin/libwinpthread-1.dll" $<TARGET_FILE_DIR:fc_script>/libwinpthread-1.dll)
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
|
@ -179,6 +187,13 @@ endif()
|
|||
|
||||
add_dependencies(fc_script KytyGitVersion)
|
||||
|
||||
file(GLOB csv_files ${CMAKE_CURRENT_BINARY_DIR}/*.csv)
|
||||
|
||||
install(TARGETS fc_script DESTINATION .)
|
||||
install(FILES ${csv_files} DESTINATION .)
|
||||
if(MSVC)
|
||||
install(FILES "3rdparty/winpthread/bin/libwinpthread-1.dll" DESTINATION .)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_USE_RELATIVE_PATHS ON)
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
"generator": "Ninja",
|
||||
"configurationType": "Release",
|
||||
"inheritEnvironments": [ "clang_cl_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\..\\_Build\\_ReleaseFinalVC2017_Clang_64_build",
|
||||
"installRoot": "${projectDir}\\..\\_Build\\_ReleaseFinalVC2017_Clang_64_install",
|
||||
"buildRoot": "${projectDir}\\..\\_Build\\_ReleaseFinalVisualStudio2019_Clang_64_build",
|
||||
"installRoot": "${projectDir}\\..\\_Build\\_ReleaseFinalVisualStudio2019_Clang_64_install",
|
||||
"cmakeCommandArgs": "-D KYTY_FINAL=1 -D KYTY_PROJECT_NAME:STRING=Emulator",
|
||||
"intelliSenseMode": "windows-clang-x64",
|
||||
"buildCommandArgs": "",
|
||||
|
@ -17,8 +17,8 @@
|
|||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"inheritEnvironments": [ "clang_cl_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\..\\_Build\\_DebugVC2017_Clang_64_build",
|
||||
"installRoot": "${projectDir}\\..\\_Build\\_DebugVC2017_Clang_64_install",
|
||||
"buildRoot": "${projectDir}\\..\\_Build\\_DebugVisualStudio2019_Clang_64_build",
|
||||
"installRoot": "${projectDir}\\..\\_Build\\_DebugVisualStudio2019_Clang_64_install",
|
||||
"cmakeCommandArgs": "-D KYTY_PROJECT_NAME:STRING=Emulator",
|
||||
"intelliSenseMode": "windows-clang-x64",
|
||||
"buildCommandArgs": "",
|
||||
|
@ -29,8 +29,8 @@
|
|||
"generator": "Ninja",
|
||||
"configurationType": "Release",
|
||||
"inheritEnvironments": [ "clang_cl_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\..\\_Build\\_BuildTools_ReleaseFinalVC2017_Clang_64_build",
|
||||
"installRoot": "${projectDir}\\..\\_Build\\_BuildTools_ReleaseFinalVC2017_Clang_64_install",
|
||||
"buildRoot": "${projectDir}\\..\\_Build\\_BuildTools_ReleaseFinalVisualStudio2019_Clang_64_build",
|
||||
"installRoot": "${projectDir}\\..\\_Build\\_BuildTools_ReleaseFinalVisualStudio2019_Clang_64_install",
|
||||
"cmakeCommandArgs": "-D KYTY_FINAL=1 -D KYTY_PROJECT_NAME:STRING=Build_Tools",
|
||||
"intelliSenseMode": "windows-clang-x64",
|
||||
"buildCommandArgs": "",
|
||||
|
|
|
@ -39,7 +39,6 @@ target_include_directories(emulator_obj PRIVATE ${inc_headers})
|
|||
list(APPEND check_headers
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
${CMAKE_SOURCE_DIR}/include
|
||||
#${CMAKE_SOURCE_DIR}/3rdparty/affinity/include
|
||||
)
|
||||
|
||||
clang_tidy_check(emulator_obj "" "${check_headers}" "${inc_headers}")
|
||||
|
|
|
@ -486,6 +486,8 @@ bool FlipQueue::Flip(uint32_t micros)
|
|||
|
||||
printf("Flip done: %d\n", r.index);
|
||||
|
||||
// m_mutex.Lock();
|
||||
|
||||
m_requests.Remove(first);
|
||||
m_done_cond_var.Signal();
|
||||
|
||||
|
@ -526,14 +528,14 @@ void VideoOutBeginVblank()
|
|||
{
|
||||
EXIT_IF(g_video_out_context == nullptr);
|
||||
|
||||
g_video_out_context->VblankBegin();
|
||||
// g_video_out_context->VblankBegin();
|
||||
}
|
||||
|
||||
void VideoOutEndVblank()
|
||||
{
|
||||
EXIT_IF(g_video_out_context == nullptr);
|
||||
|
||||
g_video_out_context->VblankEnd();
|
||||
// g_video_out_context->VblankEnd();
|
||||
}
|
||||
|
||||
KYTY_SYSV_ABI int VideoOutOpen(int user_id, int bus_type, int index, const void* param)
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
execute_process(COMMAND git describe --tags --always OUTPUT_VARIABLE KYTY_GIT_VERSION)
|
||||
#message("${GIT_EXECUTABLE}")
|
||||
if(GIT_EXECUTABLE)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always OUTPUT_VARIABLE KYTY_GIT_VERSION)
|
||||
else()
|
||||
set(KYTY_GIT_VERSION "unknown")
|
||||
endif()
|
||||
string(STRIP ${KYTY_GIT_VERSION} KYTY_GIT_VERSION)
|
||||
configure_file(${INPUT_FILE} ${OUTPUT_FILE})
|
||||
|
|
|
@ -33,6 +33,7 @@ public:
|
|||
void LoadCsv();
|
||||
|
||||
void LoadMsvcLink(const String& name, int mode);
|
||||
void LoadMsvcLldLink(const String& name, int mode);
|
||||
void LoadGnuLd(const String& name, int bitness);
|
||||
void LoadLlvmLld(const String& name, int bitness);
|
||||
void LoadCsv(const String& name);
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
|
||||
find_package(Qt5 COMPONENTS Widgets LinguistTools REQUIRED)
|
||||
|
||||
set(CMAKE_AUTOUIC_SEARCH_PATHS forms)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
file(GLOB launcher_src
|
||||
"include/*.h"
|
||||
"src/*.cpp"
|
||||
)
|
||||
|
||||
file(GLOB launcher_forms
|
||||
"forms/*.ui"
|
||||
)
|
||||
|
||||
file(GLOB launcher_res
|
||||
"res/*.qrc"
|
||||
)
|
||||
|
||||
set(launcher_ts "ts/launcher_ru_RU.ts")
|
||||
|
||||
add_executable(launcher WIN32
|
||||
${launcher_src}
|
||||
${launcher_forms}
|
||||
${launcher_res}
|
||||
${launcher_ts}
|
||||
)
|
||||
|
||||
|
||||
target_link_libraries(launcher Qt5::Widgets)
|
||||
target_link_libraries(launcher psapi)
|
||||
target_link_libraries(launcher setupapi)
|
||||
if (CLANG AND NOT MSVC)
|
||||
target_link_libraries(launcher pthread)
|
||||
endif()
|
||||
#if (CLANG AND MSVC)
|
||||
#target_link_libraries(launcher winpthread)
|
||||
#endif()
|
||||
target_include_directories(launcher PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
||||
set_target_properties(launcher PROPERTIES AUTOUIC ON AUTOMOC ON AUTORCC ON)
|
||||
|
||||
if(MINGW)
|
||||
set_target_properties(launcher PROPERTIES LINK_FLAGS "${KYTY_LD_OPTIONS}")
|
||||
endif()
|
||||
|
||||
add_dependencies(launcher KytyGitVersion)
|
||||
|
||||
find_program(QT_WINDEPLOYQT NAMES windeployqt PATHS "${Qt5_DIR}/../../../bin")
|
||||
if(NOT QT_WINDEPLOYQT)
|
||||
message(FATAL_ERROR "Could not find windeployqt")
|
||||
endif()
|
||||
|
||||
set(launcher_name "launcher")
|
||||
|
||||
set_target_properties(launcher PROPERTIES OUTPUT_NAME ${launcher_name})
|
||||
|
||||
install(TARGETS launcher DESTINATION .)
|
||||
|
||||
install(CODE "
|
||||
execute_process(
|
||||
COMMAND ${QT_WINDEPLOYQT} \"\${CMAKE_INSTALL_PREFIX}/${launcher_name}.exe\"
|
||||
--no-svg
|
||||
--no-angle
|
||||
--no-opengl
|
||||
--no-opengl-sw
|
||||
--no-system-d3d-compiler
|
||||
--no-translations
|
||||
)
|
||||
")
|
||||
|
||||
|
||||
qt5_create_translation(QM_FILES ${launcher_src} ${launcher_forms} ${launcher_ts} OPTIONS -I ${CMAKE_SOURCE_DIR}/launcher/include)
|
||||
|
||||
set(tidy_dirs "${CMAKE_SOURCE_DIR}/launcher/include")
|
||||
set(iwyu_maps "${CMAKE_SOURCE_DIR}/launcher/utils/qt5_15.imp")
|
||||
|
||||
get_property(inc_headers TARGET launcher PROPERTY INCLUDE_DIRECTORIES)
|
||||
|
||||
list(APPEND inc_headers
|
||||
${CMAKE_SOURCE_DIR}/launcher
|
||||
${CMAKE_BINARY_DIR}/launcher/launcher_autogen/include
|
||||
${Qt5_DIR}/../../../include
|
||||
${Qt5_DIR}/../../../include/QtWidgets
|
||||
${Qt5_DIR}/../../../include/QtCore
|
||||
${Qt5_DIR}/../../../include/QtGui
|
||||
)
|
||||
|
||||
include_what_you_use_with_mappings(launcher "${inc_headers}" "${iwyu_maps}")
|
||||
|
||||
clang_tidy_check(launcher "" "${tidy_dirs}" "${inc_headers}")
|
|
@ -0,0 +1,544 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ConfigurationEditDialog</class>
|
||||
<widget class="QDialog" name="ConfigurationEditDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>697</width>
|
||||
<height>587</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="locale">
|
||||
<locale language="English" country="UnitedStates"/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="MandatoryLineEdit" name="name_lineedit">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Configuration name</p></body></html></string>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="file_groupbox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Mount app0 to</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="MandatoryLineEdit" name="base_directory_lineedit">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Name of the directory where game is located</p></body></html></string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="browse_base_dir_button">
|
||||
<property name="text">
|
||||
<string>Browse...</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QFrame" name="configuaration_groupbox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_6">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string>Screen resoultion:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="comboBox_screen_resolution">
|
||||
<property name="toolTip">
|
||||
<string>Window resolution</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QFrame" name="frame_4">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_neo">
|
||||
<property name="toolTip">
|
||||
<string>Enable PS4 Pro mode</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Neo</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="checkBox_shader_validation">
|
||||
<property name="toolTip">
|
||||
<string>Validate SPIR-V binary</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Shader validation</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_vulkan_validation">
|
||||
<property name="toolTip">
|
||||
<string>Enable Vulkan validation layers</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Vulkan validation</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="checkBox_cmd_dump">
|
||||
<property name="toolTip">
|
||||
<string>Dump command buffers</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Command buffer dump</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_spirv_printf">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Enable GL_EXT_debug_printf extension</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Spirv debug printf</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="text">
|
||||
<string>Shader optimization type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="comboBox_shader_optimization_type">
|
||||
<property name="toolTip">
|
||||
<string>Optimize shaders for code size or performance</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="comboBox_shader_log_direction">
|
||||
<property name="toolTip">
|
||||
<string>Dump shaders to file or console window. If enabled may decrease emulator performance</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="MandatoryLineEdit" name="lineEdit_shader_log_folder">
|
||||
<property name="toolTip">
|
||||
<string>Specify directory to dump shaders</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="MandatoryLineEdit" name="lineEdit_cmd_dump_folder">
|
||||
<property name="toolTip">
|
||||
<string>Specify directory to dump command buffers</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QComboBox" name="comboBox_printf_direction">
|
||||
<property name="toolTip">
|
||||
<string>Print logs to file or console window. If enabled may decrease emulator performance</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="MandatoryLineEdit" name="lineEdit_printf_file">
|
||||
<property name="toolTip">
|
||||
<string>Specify file to dump logs</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QComboBox" name="comboBox_profiler_direction">
|
||||
<property name="toolTip">
|
||||
<string>Enable/disable profiler. If enabled may decrease emulator performance</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_21">
|
||||
<property name="text">
|
||||
<string>Shader log direction:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_22">
|
||||
<property name="text">
|
||||
<string>Shader log folder:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_24">
|
||||
<property name="text">
|
||||
<string>Command buffer dump folder:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_25">
|
||||
<property name="text">
|
||||
<string>Printf direction:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_26">
|
||||
<property name="text">
|
||||
<string>Printf output file:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_27">
|
||||
<property name="text">
|
||||
<string>Profiler direction:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="MandatoryLineEdit" name="lineEdit_profiler_file">
|
||||
<property name="toolTip">
|
||||
<string>Specify file to dump profiler info</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_28">
|
||||
<property name="text">
|
||||
<string>Profiler output file:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Load elf:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QListWidget" name="listWidget_elfs">
|
||||
<property name="toolTip">
|
||||
<string>Select executables to load</string>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_3">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="1" column="0">
|
||||
<widget class="QListWidget" name="listWidget_libs">
|
||||
<property name="toolTip">
|
||||
<string>Select libraries to load</string>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Load library:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="ok_button">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cancel_button">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="clear_button">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="test_button">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Test</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>MandatoryLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>MandatoryLineEdit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>cancel_button</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>ConfigurationEditDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>574</x>
|
||||
<y>65</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>199</x>
|
||||
<y>167</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
|
@ -0,0 +1,184 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ConfigurationListWidget</class>
|
||||
<widget class="QWidget" name="ConfigurationListWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>292</width>
|
||||
<height>268</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Configurations</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="add_button">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>New configuration</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../res/res.qrc">
|
||||
<normaloff>:/add</normaloff>:/add</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="edit_button">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Edit configuration</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../res/res.qrc">
|
||||
<normaloff>:/edit</normaloff>:/edit</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="delete_button">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Delete configuration</p></body></html></string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../res/res.qrc">
|
||||
<normaloff>:/delete</normaloff>:/delete</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="cfgs_list">
|
||||
<property name="movement">
|
||||
<enum>QListView::Static</enum>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../res/res.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainDialog</class>
|
||||
<widget class="QDialog" name="MainDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>428</width>
|
||||
<height>454</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Kyty Launcher</string>
|
||||
</property>
|
||||
<property name="locale">
|
||||
<locale language="English" country="UnitedStates"/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="ConfigurationListWidget" name="widget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_settings_file">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_Interpreter">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_Version">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_Cmd">
|
||||
<property name="text">
|
||||
<string>Cmd</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup_Console</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_ConEmu">
|
||||
<property name="text">
|
||||
<string>ConEmu</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup_Console</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_Run">
|
||||
<property name="text">
|
||||
<string>Run</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ConfigurationListWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>ConfigurationListWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../res/res.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="buttonGroup_Console"/>
|
||||
</buttongroups>
|
||||
</ui>
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef LAUNCHER_INCLUDE_COMMON_H_
|
||||
#define LAUNCHER_INCLUDE_COMMON_H_
|
||||
|
||||
// IWYU pragma: begin_exports
|
||||
#include <QArgument>
|
||||
#include <QObject>
|
||||
|
||||
#include <cinttypes>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
// IWYU pragma: end_exports
|
||||
|
||||
#define KYTY_QT_CLASS_NO_COPY(name) \
|
||||
public: \
|
||||
name(const name&) = delete; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||
name& operator=(const name&) = delete; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||
name(name&&) noexcept = delete; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||
name& operator=(name&&) noexcept = delete; /* NOLINT(bugprone-macro-parentheses) */
|
||||
|
||||
#define KYTY_QT_CLASS_DEFAULT_COPY(name) \
|
||||
public: \
|
||||
name(const name&) = default; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||
name& operator=(const name&) = default; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||
name(name&&) noexcept = default; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||
name& operator=(name&&) noexcept = default; /* NOLINT(bugprone-macro-parentheses) */
|
||||
|
||||
#endif /* LAUNCHER_INCLUDE_COMMON_H_ */
|
|
@ -0,0 +1,180 @@
|
|||
#ifndef LAUNCHER_INCLUDE_CONFIGURATION_H_
|
||||
#define LAUNCHER_INCLUDE_CONFIGURATION_H_
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QChar>
|
||||
#include <QMetaEnum>
|
||||
#include <QMetaType>
|
||||
#include <QSettings>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QVariant>
|
||||
|
||||
#define KYTY_CFG_SETL(n) s->setValue(#n, n);
|
||||
#define KYTY_CFG_SET(n) s->setValue(#n, QVariant::fromValue(n).toString());
|
||||
#define KYTY_CFG_GET(n) n = s->value(#n).value<decltype(n)>();
|
||||
#define KYTY_CFG_GETL(n) n = s->value(#n).toStringList();
|
||||
|
||||
#define KYTY_LIBS \
|
||||
{ \
|
||||
"libc_internal_1", "libkernel_1", "libVideoOut_1", "libSysmodule_1", "libDiscMap_1", "libDebug_1", "libGraphicsDriver_1", \
|
||||
"libUserService_1", "libPad_1" \
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline QStringList EnumToList()
|
||||
{
|
||||
QStringList ret;
|
||||
auto me = QMetaEnum::fromType<T>();
|
||||
int count = me.keyCount();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
auto key = QString(me.key(i));
|
||||
ret << (key.startsWith('R') && key.size() > 2 && key.at(1).isDigit() ? key.remove('R').toLower() : key);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
T TextToEnum(const QString& text)
|
||||
{
|
||||
auto me = QMetaEnum::fromType<T>();
|
||||
return static_cast<T>(me.keyToValue(((text.size() > 1 && text.at(0).isDigit()) ? 'R' + text.toUpper() : text).toUtf8().data()));
|
||||
}
|
||||
|
||||
template <class T>
|
||||
QString EnumToText(T value)
|
||||
{
|
||||
auto me = QMetaEnum::fromType<T>();
|
||||
auto key = QString(me.valueToKey(static_cast<int>(value)));
|
||||
return (key.startsWith('R') && key.size() > 2 && key.at(1).isDigit() ? key.remove('R').toLower() : key);
|
||||
}
|
||||
|
||||
namespace Kyty {
|
||||
|
||||
class Configuration: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum class Resolution
|
||||
{
|
||||
R1280X720,
|
||||
R1920X1080,
|
||||
};
|
||||
Q_ENUM(Resolution)
|
||||
|
||||
enum class ShaderOptimizationType
|
||||
{
|
||||
None,
|
||||
Size,
|
||||
Performance
|
||||
};
|
||||
Q_ENUM(ShaderOptimizationType)
|
||||
|
||||
enum class ShaderLogDirection
|
||||
{
|
||||
Silent,
|
||||
Console,
|
||||
File
|
||||
};
|
||||
Q_ENUM(ShaderLogDirection)
|
||||
|
||||
enum class ProfilerDirection
|
||||
{
|
||||
None,
|
||||
File,
|
||||
Network,
|
||||
FileAndNetwork
|
||||
};
|
||||
Q_ENUM(ProfilerDirection)
|
||||
|
||||
enum class LogDirection
|
||||
{
|
||||
Silent,
|
||||
Console,
|
||||
File
|
||||
};
|
||||
Q_ENUM(LogDirection)
|
||||
|
||||
Configuration() = default;
|
||||
|
||||
QString Name;
|
||||
QString BaseDir; /* Game base directory */
|
||||
|
||||
Resolution screen_resolution = Resolution::R1280X720;
|
||||
bool neo = true;
|
||||
bool vulkan_validation_enabled = true;
|
||||
bool shader_validation_enabled = true;
|
||||
ShaderOptimizationType shader_optimization_type = ShaderOptimizationType::Performance;
|
||||
ShaderLogDirection shader_log_direction = ShaderLogDirection::Silent;
|
||||
QString shader_log_folder = "_Shaders";
|
||||
bool command_buffer_dump_enabled = false;
|
||||
QString command_buffer_dump_folder = "_Buffers";
|
||||
LogDirection printf_direction = LogDirection::Silent;
|
||||
QString printf_output_file = "_kyty.txt";
|
||||
ProfilerDirection profiler_direction = ProfilerDirection::None;
|
||||
QString profiler_output_file = "_profile.prof";
|
||||
bool spirv_debug_printf_enabled = false;
|
||||
|
||||
QStringList elfs;
|
||||
QStringList elfs_selected;
|
||||
QStringList libs = KYTY_LIBS;
|
||||
QStringList libs_selected = KYTY_LIBS;
|
||||
|
||||
void WriteSettings(QSettings* s) const
|
||||
{
|
||||
KYTY_CFG_SET(Name);
|
||||
KYTY_CFG_SET(BaseDir);
|
||||
KYTY_CFG_SET(screen_resolution);
|
||||
KYTY_CFG_SET(neo);
|
||||
KYTY_CFG_SET(vulkan_validation_enabled);
|
||||
KYTY_CFG_SET(shader_validation_enabled);
|
||||
KYTY_CFG_SET(shader_optimization_type);
|
||||
KYTY_CFG_SET(shader_log_direction);
|
||||
KYTY_CFG_SET(shader_log_folder);
|
||||
KYTY_CFG_SET(command_buffer_dump_enabled);
|
||||
KYTY_CFG_SET(command_buffer_dump_folder);
|
||||
KYTY_CFG_SET(printf_direction);
|
||||
KYTY_CFG_SET(printf_output_file);
|
||||
KYTY_CFG_SET(profiler_direction);
|
||||
KYTY_CFG_SET(profiler_output_file);
|
||||
KYTY_CFG_SET(spirv_debug_printf_enabled);
|
||||
KYTY_CFG_SETL(elfs);
|
||||
KYTY_CFG_SETL(elfs_selected);
|
||||
KYTY_CFG_SETL(libs);
|
||||
KYTY_CFG_SETL(libs_selected);
|
||||
}
|
||||
|
||||
void ReadSettings(QSettings* s)
|
||||
{
|
||||
KYTY_CFG_GET(Name);
|
||||
KYTY_CFG_GET(BaseDir);
|
||||
KYTY_CFG_GET(screen_resolution);
|
||||
KYTY_CFG_GET(neo);
|
||||
KYTY_CFG_GET(vulkan_validation_enabled);
|
||||
KYTY_CFG_GET(shader_validation_enabled);
|
||||
KYTY_CFG_GET(shader_optimization_type);
|
||||
KYTY_CFG_GET(shader_log_direction);
|
||||
KYTY_CFG_GET(shader_log_folder);
|
||||
KYTY_CFG_GET(command_buffer_dump_enabled);
|
||||
KYTY_CFG_GET(command_buffer_dump_folder);
|
||||
KYTY_CFG_GET(printf_direction);
|
||||
KYTY_CFG_GET(printf_output_file);
|
||||
KYTY_CFG_GET(profiler_direction);
|
||||
KYTY_CFG_GET(profiler_output_file);
|
||||
KYTY_CFG_GET(spirv_debug_printf_enabled);
|
||||
KYTY_CFG_GETL(elfs);
|
||||
KYTY_CFG_GETL(elfs_selected);
|
||||
KYTY_CFG_GETL(libs);
|
||||
KYTY_CFG_GETL(libs_selected);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Kyty
|
||||
|
||||
Q_DECLARE_METATYPE(Kyty::Configuration*)
|
||||
|
||||
#endif /* LAUNCHER_INCLUDE_CONFIGURATION_H_ */
|
|
@ -0,0 +1,62 @@
|
|||
#ifndef CONFIGURATION_EDIT_DIALOG_H
|
||||
#define CONFIGURATION_EDIT_DIALOG_H
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QProcess>
|
||||
#include <QString>
|
||||
class QByteArray;
|
||||
class QMoveEvent;
|
||||
class QSettings;
|
||||
class ConfigurationListWidget;
|
||||
|
||||
namespace Kyty {
|
||||
class Configuration;
|
||||
} // namespace Kyty
|
||||
|
||||
namespace Ui {
|
||||
class ConfigurationEditDialog;
|
||||
} // namespace Ui
|
||||
|
||||
class ConfigurationEditDialog: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
KYTY_QT_CLASS_NO_COPY(ConfigurationEditDialog);
|
||||
|
||||
public:
|
||||
explicit ConfigurationEditDialog(Kyty::Configuration* info, ConfigurationListWidget* parent = nullptr);
|
||||
~ConfigurationEditDialog() override;
|
||||
|
||||
static void WriteSettings(QSettings* s);
|
||||
static void ReadSettings(QSettings* s);
|
||||
|
||||
void SetTitle(const QString& str);
|
||||
|
||||
private:
|
||||
Ui::ConfigurationEditDialog* m_ui = nullptr;
|
||||
Kyty::Configuration* m_info = nullptr;
|
||||
QProcess m_process;
|
||||
ConfigurationListWidget* m_parent = nullptr;
|
||||
|
||||
protected:
|
||||
void Init();
|
||||
|
||||
void moveEvent(QMoveEvent* event) override;
|
||||
|
||||
static QString g_last_base_dir;
|
||||
static QByteArray g_last_geometry;
|
||||
|
||||
/*slots:*/
|
||||
|
||||
void update_info();
|
||||
void adjust_size();
|
||||
void save();
|
||||
void browse_base_path();
|
||||
void scan_elfs();
|
||||
void scan_libs();
|
||||
void clear();
|
||||
void test();
|
||||
};
|
||||
|
||||
#endif // CONFIGURATION_EDIT_DIALOG_H
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef CONFIGURATION_ITEM_H
|
||||
#define CONFIGURATION_ITEM_H
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#include <QListWidgetItem>
|
||||
|
||||
namespace Kyty {
|
||||
class Configuration;
|
||||
} // namespace Kyty
|
||||
|
||||
class ConfigurationItem: public QListWidgetItem
|
||||
{
|
||||
public:
|
||||
explicit ConfigurationItem(Kyty::Configuration* info, QListWidget* parent);
|
||||
~ConfigurationItem() override;
|
||||
|
||||
void Update();
|
||||
|
||||
KYTY_QT_CLASS_NO_COPY(ConfigurationItem);
|
||||
|
||||
Kyty::Configuration* GetInfo() { return m_info; }
|
||||
[[nodiscard]] const Kyty::Configuration* GetInfo() const { return m_info; }
|
||||
// void SetInfo(Kyty::Configuration* info);
|
||||
void SetRunning(bool state);
|
||||
[[nodiscard]] bool IsRunning() const { return m_running; }
|
||||
|
||||
private:
|
||||
Kyty::Configuration* m_info = nullptr;
|
||||
bool m_running = false;
|
||||
};
|
||||
|
||||
#endif // CONFIGURATION_ITEM_H
|
|
@ -0,0 +1,64 @@
|
|||
#ifndef CONFIGURATION_LIST_WIDGET_H
|
||||
#define CONFIGURATION_LIST_WIDGET_H
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
class ConfigurationItem;
|
||||
class QListWidgetItem;
|
||||
class QPoint;
|
||||
class MainDialog;
|
||||
|
||||
namespace Ui {
|
||||
class ConfigurationListWidget;
|
||||
} // namespace Ui
|
||||
|
||||
class ConfigurationListWidget: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
KYTY_QT_CLASS_NO_COPY(ConfigurationListWidget);
|
||||
|
||||
public:
|
||||
explicit ConfigurationListWidget(QWidget* parent = nullptr);
|
||||
~ConfigurationListWidget() override;
|
||||
|
||||
void SetRunEnabled(bool flag) { m_run_enabled = flag; }
|
||||
[[nodiscard]] bool IsRunEnabled() const { return m_run_enabled; }
|
||||
|
||||
[[nodiscard]] const ConfigurationItem* GetSelectedItem() const { return m_selected_item; }
|
||||
ConfigurationItem* GetSelectedItem() { return m_selected_item; }
|
||||
|
||||
void SetMainDialog(MainDialog* main_dialog) { m_main_dialog = main_dialog; }
|
||||
MainDialog* GetMainDialog() { return m_main_dialog; }
|
||||
|
||||
[[nodiscard]] const QString& GetSettingsFile() const { return m_settings_file; }
|
||||
|
||||
signals:
|
||||
|
||||
void Run();
|
||||
void Select();
|
||||
|
||||
public slots:
|
||||
void WriteSettings();
|
||||
void ReadSettings();
|
||||
|
||||
protected slots:
|
||||
|
||||
void add_configuration();
|
||||
void edit_configuration();
|
||||
void delete_configuartion();
|
||||
void run_configuration();
|
||||
void list_itemClicked(QListWidgetItem* witem);
|
||||
void show_context_menu(const QPoint& pos);
|
||||
|
||||
private:
|
||||
ConfigurationItem* m_selected_item = nullptr;
|
||||
bool m_run_enabled = true;
|
||||
Ui::ConfigurationListWidget* m_ui = nullptr;
|
||||
MainDialog* m_main_dialog = nullptr;
|
||||
QString m_settings_file;
|
||||
};
|
||||
|
||||
#endif // CONFIGURATION_LIST_WIDGET_H
|
|
@ -0,0 +1,44 @@
|
|||
#ifndef MAIN_DIALOG_H
|
||||
#define MAIN_DIALOG_H
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QString>
|
||||
|
||||
class QWidget;
|
||||
class QProcess;
|
||||
class MainDialogPrivate;
|
||||
class QSettings;
|
||||
class QResizeEvent;
|
||||
|
||||
namespace Kyty {
|
||||
class Configuration;
|
||||
} // namespace Kyty
|
||||
|
||||
class MainDialog: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
KYTY_QT_CLASS_NO_COPY(MainDialog);
|
||||
|
||||
signals:
|
||||
void Start();
|
||||
void Quit();
|
||||
void Resize();
|
||||
|
||||
public:
|
||||
explicit MainDialog(QWidget* parent = nullptr);
|
||||
~MainDialog() override = default;
|
||||
|
||||
void RunInterpreter(QProcess* process, Kyty::Configuration* info, bool con_emu);
|
||||
|
||||
static void WriteSettings(QSettings* s);
|
||||
static void ReadSettings(QSettings* s);
|
||||
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
|
||||
private:
|
||||
MainDialogPrivate* m_p = nullptr;
|
||||
};
|
||||
|
||||
#endif // MAIN_DIALOG_H
|
|
@ -0,0 +1,30 @@
|
|||
#ifndef MANDATORY_LINEEDIT_H
|
||||
#define MANDATORY_LINEEDIT_H
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QString>
|
||||
|
||||
class QPaintEvent;
|
||||
class QWidget;
|
||||
|
||||
constexpr char MANDATORY_AND_EMPTY[] = "mandatory_and_empty";
|
||||
|
||||
class MandatoryLineEdit: public QLineEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MandatoryLineEdit(QWidget* parent = nullptr);
|
||||
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
|
||||
static bool FindEmpty(QObject* p);
|
||||
|
||||
protected slots:
|
||||
|
||||
void changed(const QString& text);
|
||||
};
|
||||
|
||||
#endif // MANDATORY_LINEEDIT_H
|
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 508 B |
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 857 B |
|
@ -0,0 +1,53 @@
|
|||
Free FatCow-Farm Fresh Icons
|
||||
http://www.fatcow.com/free-icons
|
||||
|
||||
FatCow Farm-Fresh final release (3926 icons, 5 parts):
|
||||
- fatcow-hosting-icons-3.9.2.zip default (10.9 Mb)
|
||||
- fatcow-hosting-icons-3.9.2-color.zip (11.1 Mb)
|
||||
- fatcow-hosting-icons-3.9.2-grey.zip (6.9 Mb)
|
||||
- fatcow-hosting-icons-3.9.2-ico.zip (8.9 Mb)
|
||||
- fatcow-hosting-icons-3.9.2-all.zip (30.7 Mb)
|
||||
- fatcow-hosting-icons-3.9.2-ai-src.zip (2.82 !Gb)
|
||||
|
||||
|
||||
Farm-Fresh v3.92, 10-04-2014
|
||||
-----------------------------------------
|
||||
- 126 new 32x32 and 16x16 icons added (total of 252 files)
|
||||
- 139 icons renamed as per Tango Icon Theme Guidelines
|
||||
- 10 new 48x48 and 96x96 Retina ready icons (added)
|
||||
- Adobe Illustrator .ai vector source files (added)
|
||||
- greyscale version of color icons in .png (added)
|
||||
- .ico files of all .png icons files (added)
|
||||
- icons sorted by 11 base colors (added)
|
||||
---------------------------------------------------------------------------------
|
||||
|
||||
Farm-Fresh v3.80, 10-25-2013
|
||||
-----------------------------------------
|
||||
- 300 new 32x32 and 16x16 icons added (total of 600)
|
||||
---------------------------------------------------------------------------------
|
||||
|
||||
Farm-Fresh v3.50, 29-03-2013
|
||||
-----------------------------------------
|
||||
- 500 new 32x32 and 16x16 icons added (total of 1,000)
|
||||
|
||||
|
||||
These icons are licensed under a Creative Commons Attribution 3.0 License.
|
||||
http://creativecommons.org/licenses/by/3.0/us/ if you do not know how to link
|
||||
back to FatCow's website, you can ask https://plus.google.com/+MarcisGasuns
|
||||
Biggest icon set drawn by a single designer (in pixel smooth style) worldwide.
|
||||
|
||||
We are unavailable for custom icon design work. The project is
|
||||
closed (April 2014) and we do not plan to draw more metaphors.
|
||||
http://twitter.com/FatCow
|
||||
http://plus.google.com/+FatCow
|
||||
http://www.facebook.com/FatCow
|
||||
|
||||
---------------------------------------------------------------------------------
|
||||
|
||||
© Copyright 2009-2014 FatCow Web Hosting. All rights reserved.
|
||||
http://www.fatcow.com
|
||||
|
||||
All other trademarks and copyrights
|
||||
are property of their respective owners.
|
||||
|
||||
---------------------------------------------------------------------------------
|
|
@ -0,0 +1,10 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file alias="delete">cross.png</file>
|
||||
<file alias="save">diskette.png</file>
|
||||
<file alias="add">layout_add.png</file>
|
||||
<file alias="edit">pencil.png</file>
|
||||
<file alias="application">layout.png</file>
|
||||
<file alias="running">time_go.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
Binary file not shown.
After Width: | Height: | Size: 911 B |
|
@ -0,0 +1 @@
|
|||
#include "Configuration.h"
|
|
@ -0,0 +1,386 @@
|
|||
#include "ConfigurationEditDialog.h"
|
||||
|
||||
#include "Configuration.h"
|
||||
#include "ConfigurationListWidget.h"
|
||||
#include "MainDialog.h"
|
||||
#include "MandatoryLineEdit.h"
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QCheckBox>
|
||||
#include <QColor>
|
||||
#include <QComboBox>
|
||||
#include <QDir>
|
||||
#include <QDirIterator>
|
||||
#include <QFileDialog>
|
||||
#include <QFlags>
|
||||
#include <QInternal>
|
||||
#include <QLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QList>
|
||||
#include <QListWidget>
|
||||
#include <QListWidgetItem>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QSettings>
|
||||
#include <QStringList>
|
||||
#include <QVariant>
|
||||
|
||||
#include "ui_configuration_edit_dialog.h"
|
||||
|
||||
constexpr char SETTINGS_CFG_DIALOG[] = "ConfigurationEditDialog";
|
||||
constexpr char SETTINGS_CFG_LAST_GEOMETRY[] = "geometry";
|
||||
constexpr char SETTINGS_LAST_BASE_DIR[] = "last_base_dir";
|
||||
constexpr char COLOR_SELECTED[] = "#e2ffe2";
|
||||
constexpr char COLOR_NOT_SELECTED[] = "#ffffff";
|
||||
|
||||
static void ChangeColor(QListWidgetItem* item)
|
||||
{
|
||||
if (item->checkState() == Qt::Checked)
|
||||
{
|
||||
item->setBackground(QColor(COLOR_SELECTED));
|
||||
} else
|
||||
{
|
||||
item->setBackground(QColor(COLOR_NOT_SELECTED));
|
||||
}
|
||||
}
|
||||
|
||||
ConfigurationEditDialog::ConfigurationEditDialog(Kyty::Configuration* info, ConfigurationListWidget* parent)
|
||||
: QDialog(parent, Qt::WindowCloseButtonHint), m_ui(new Ui::ConfigurationEditDialog), m_parent(parent)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
connect(m_ui->ok_button, &QPushButton::clicked, this, &ConfigurationEditDialog::save);
|
||||
connect(m_ui->clear_button, &QPushButton::clicked, this, &ConfigurationEditDialog::clear);
|
||||
connect(m_ui->test_button, &QPushButton::clicked, this, &ConfigurationEditDialog::test);
|
||||
connect(m_ui->browse_base_dir_button, &QPushButton::clicked, this, &ConfigurationEditDialog::browse_base_path);
|
||||
connect(m_ui->comboBox_shader_log_direction, &QComboBox::currentTextChanged,
|
||||
[=](const QString& text)
|
||||
{
|
||||
auto log = TextToEnum<Kyty::Configuration::ShaderLogDirection>(text);
|
||||
m_ui->lineEdit_shader_log_folder->setEnabled(log == Kyty::Configuration::ShaderLogDirection::File);
|
||||
});
|
||||
connect(m_ui->checkBox_cmd_dump, &QCheckBox::toggled, [=](bool flag) { m_ui->lineEdit_cmd_dump_folder->setEnabled(flag); });
|
||||
connect(m_ui->comboBox_printf_direction, &QComboBox::currentTextChanged,
|
||||
[=](const QString& text)
|
||||
{
|
||||
auto log = TextToEnum<Kyty::Configuration::LogDirection>(text);
|
||||
m_ui->lineEdit_printf_file->setEnabled(log == Kyty::Configuration::LogDirection::File);
|
||||
});
|
||||
connect(m_ui->comboBox_profiler_direction, &QComboBox::currentTextChanged,
|
||||
[=](const QString& text)
|
||||
{
|
||||
auto log = TextToEnum<Kyty::Configuration::ProfilerDirection>(text);
|
||||
m_ui->lineEdit_profiler_file->setEnabled(log == Kyty::Configuration::ProfilerDirection::File ||
|
||||
log == Kyty::Configuration::ProfilerDirection::FileAndNetwork);
|
||||
});
|
||||
connect(m_ui->base_directory_lineedit, &QLineEdit::textChanged, this, &ConfigurationEditDialog::scan_elfs);
|
||||
connect(m_ui->listWidget_elfs, &QListWidget::itemChanged, this, &ChangeColor);
|
||||
connect(m_ui->listWidget_libs, &QListWidget::itemChanged, this, &ChangeColor);
|
||||
connect(&m_process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
||||
[=](int /*exitCode*/, QProcess::ExitStatus /*exitStatus*/) { m_ui->test_button->setEnabled(true); });
|
||||
|
||||
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||
|
||||
restoreGeometry(g_last_geometry);
|
||||
|
||||
m_info = info;
|
||||
|
||||
Init();
|
||||
|
||||
scan_libs();
|
||||
scan_elfs();
|
||||
}
|
||||
|
||||
QString ConfigurationEditDialog::g_last_base_dir;
|
||||
QByteArray ConfigurationEditDialog::g_last_geometry;
|
||||
|
||||
ConfigurationEditDialog::~ConfigurationEditDialog()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void ConfigurationEditDialog::WriteSettings(QSettings* s)
|
||||
{
|
||||
s->beginGroup(SETTINGS_CFG_DIALOG);
|
||||
|
||||
if (!g_last_base_dir.isEmpty())
|
||||
{
|
||||
s->setValue(SETTINGS_LAST_BASE_DIR, g_last_base_dir);
|
||||
}
|
||||
|
||||
if (!g_last_geometry.isEmpty())
|
||||
{
|
||||
s->setValue(SETTINGS_CFG_LAST_GEOMETRY, g_last_geometry);
|
||||
}
|
||||
|
||||
s->endGroup();
|
||||
}
|
||||
|
||||
void ConfigurationEditDialog::ReadSettings(QSettings* s)
|
||||
{
|
||||
s->beginGroup(SETTINGS_CFG_DIALOG);
|
||||
|
||||
g_last_base_dir = s->value(SETTINGS_LAST_BASE_DIR, g_last_base_dir).toString();
|
||||
g_last_geometry = s->value(SETTINGS_CFG_LAST_GEOMETRY, g_last_geometry).toByteArray();
|
||||
|
||||
s->endGroup();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static void ListInit(QComboBox* combo, T value)
|
||||
{
|
||||
combo->clear();
|
||||
combo->addItems(EnumToList<T>());
|
||||
combo->setCurrentText(EnumToText(value));
|
||||
}
|
||||
|
||||
void ConfigurationEditDialog::Init()
|
||||
{
|
||||
m_ui->name_lineedit->setText(m_info->Name);
|
||||
m_ui->base_directory_lineedit->setText(m_info->BaseDir);
|
||||
ListInit(m_ui->comboBox_screen_resolution, m_info->screen_resolution);
|
||||
m_ui->checkBox_neo->setChecked(m_info->neo);
|
||||
m_ui->checkBox_shader_validation->setChecked(m_info->shader_validation_enabled);
|
||||
m_ui->checkBox_vulkan_validation->setChecked(m_info->vulkan_validation_enabled);
|
||||
ListInit(m_ui->comboBox_shader_optimization_type, m_info->shader_optimization_type);
|
||||
ListInit(m_ui->comboBox_shader_log_direction, m_info->shader_log_direction);
|
||||
m_ui->lineEdit_shader_log_folder->setText(m_info->shader_log_folder);
|
||||
m_ui->checkBox_cmd_dump->setChecked(m_info->command_buffer_dump_enabled);
|
||||
m_ui->lineEdit_cmd_dump_folder->setText(m_info->command_buffer_dump_folder);
|
||||
ListInit(m_ui->comboBox_printf_direction, m_info->printf_direction);
|
||||
m_ui->lineEdit_printf_file->setText(m_info->printf_output_file);
|
||||
ListInit(m_ui->comboBox_profiler_direction, m_info->profiler_direction);
|
||||
m_ui->lineEdit_profiler_file->setText(m_info->profiler_output_file);
|
||||
m_ui->checkBox_spirv_printf->setChecked(m_info->spirv_debug_printf_enabled);
|
||||
}
|
||||
|
||||
void ConfigurationEditDialog::SetTitle(const QString& str)
|
||||
{
|
||||
setWindowTitle(str);
|
||||
}
|
||||
|
||||
void ConfigurationEditDialog::moveEvent(QMoveEvent* event)
|
||||
{
|
||||
QDialog::moveEvent(event);
|
||||
g_last_geometry = saveGeometry();
|
||||
}
|
||||
|
||||
static void UpdateList(QStringList* list, QStringList* list_selected, QListWidget* list_widget)
|
||||
{
|
||||
list->clear();
|
||||
list_selected->clear();
|
||||
int libs_count = list_widget->count();
|
||||
for (int i = 0; i < libs_count; i++)
|
||||
{
|
||||
auto* item = list_widget->item(i);
|
||||
if ((item->flags() & Qt::ItemIsEnabled) != 0)
|
||||
{
|
||||
*list << item->text();
|
||||
if (item->checkState() == Qt::Checked)
|
||||
{
|
||||
*list_selected << item->text();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void UpdateInfo(Kyty::Configuration* info, Ui::ConfigurationEditDialog* ui)
|
||||
{
|
||||
info->Name = ui->name_lineedit->text();
|
||||
info->BaseDir = ui->base_directory_lineedit->text();
|
||||
info->screen_resolution = TextToEnum<Kyty::Configuration::Resolution>(ui->comboBox_screen_resolution->currentText());
|
||||
info->neo = ui->checkBox_neo->isChecked();
|
||||
info->vulkan_validation_enabled = ui->checkBox_vulkan_validation->isChecked();
|
||||
info->shader_validation_enabled = ui->checkBox_shader_validation->isChecked();
|
||||
info->shader_optimization_type =
|
||||
TextToEnum<Kyty::Configuration::ShaderOptimizationType>(ui->comboBox_shader_optimization_type->currentText());
|
||||
info->shader_log_direction = TextToEnum<Kyty::Configuration::ShaderLogDirection>(ui->comboBox_shader_log_direction->currentText());
|
||||
info->shader_log_folder = ui->lineEdit_shader_log_folder->text();
|
||||
info->command_buffer_dump_enabled = ui->checkBox_cmd_dump->isChecked();
|
||||
info->command_buffer_dump_folder = ui->lineEdit_cmd_dump_folder->text();
|
||||
info->printf_direction = TextToEnum<Kyty::Configuration::LogDirection>(ui->comboBox_printf_direction->currentText());
|
||||
info->printf_output_file = ui->lineEdit_printf_file->text();
|
||||
info->profiler_direction = TextToEnum<Kyty::Configuration::ProfilerDirection>(ui->comboBox_profiler_direction->currentText());
|
||||
info->profiler_output_file = ui->lineEdit_profiler_file->text();
|
||||
info->spirv_debug_printf_enabled = ui->checkBox_spirv_printf->isChecked();
|
||||
|
||||
info->elfs.clear();
|
||||
info->elfs_selected.clear();
|
||||
int libs_count = ui->listWidget_elfs->count();
|
||||
for (int i = 0; i < libs_count; i++)
|
||||
{
|
||||
auto* item = ui->listWidget_elfs->item(i);
|
||||
if ((item->flags() & Qt::ItemIsEnabled) != 0)
|
||||
{
|
||||
info->elfs << item->text();
|
||||
if (item->checkState() == Qt::Checked)
|
||||
{
|
||||
info->elfs_selected << item->text();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UpdateList(&info->elfs, &info->elfs_selected, ui->listWidget_elfs);
|
||||
UpdateList(&info->libs, &info->libs_selected, ui->listWidget_libs);
|
||||
}
|
||||
|
||||
void ConfigurationEditDialog::update_info()
|
||||
{
|
||||
UpdateInfo(m_info, m_ui);
|
||||
}
|
||||
|
||||
void ConfigurationEditDialog::adjust_size()
|
||||
{
|
||||
this->adjustSize();
|
||||
}
|
||||
|
||||
void ConfigurationEditDialog::save()
|
||||
{
|
||||
if (MandatoryLineEdit::FindEmpty(this))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Save failed"), tr("Please fill all mandatory fields"));
|
||||
return;
|
||||
}
|
||||
|
||||
update_info();
|
||||
|
||||
emit accept();
|
||||
}
|
||||
|
||||
void ConfigurationEditDialog::browse_base_path()
|
||||
{
|
||||
QString text = m_ui->base_directory_lineedit->text();
|
||||
|
||||
QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), text.isEmpty() ? g_last_base_dir : text);
|
||||
|
||||
if (!dir.isEmpty())
|
||||
{
|
||||
m_ui->base_directory_lineedit->setText(dir);
|
||||
g_last_base_dir = dir;
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigurationEditDialog::scan_elfs()
|
||||
{
|
||||
auto dir = m_ui->base_directory_lineedit->text();
|
||||
auto qdir = QDir(dir);
|
||||
bool dir_exists = !dir.isEmpty() && qdir.exists();
|
||||
|
||||
QStringList elfs;
|
||||
|
||||
if (dir_exists)
|
||||
{
|
||||
QDirIterator it(dir, QStringList({"*.elf", "*.prx", "*.sprx", "eboot.bin"}), QDir::Files, QDirIterator::Subdirectories);
|
||||
while (it.hasNext())
|
||||
{
|
||||
auto file = it.next();
|
||||
elfs << qdir.relativeFilePath(file);
|
||||
}
|
||||
}
|
||||
|
||||
m_ui->listWidget_elfs->clear();
|
||||
|
||||
int selected_num = 0;
|
||||
|
||||
for (const auto& elf: m_info->elfs)
|
||||
{
|
||||
bool not_enabled = !elfs.contains(elf);
|
||||
bool selected = m_info->elfs_selected.contains(elf);
|
||||
|
||||
auto* item = new QListWidgetItem(elf, m_ui->listWidget_elfs);
|
||||
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
||||
|
||||
if (not_enabled)
|
||||
{
|
||||
item->setCheckState(Qt::Unchecked);
|
||||
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
|
||||
} else
|
||||
{
|
||||
item->setCheckState(selected ? Qt::Checked : Qt::Unchecked);
|
||||
}
|
||||
|
||||
selected_num += (selected ? 1 : 0);
|
||||
}
|
||||
|
||||
for (const auto& elf: elfs)
|
||||
{
|
||||
if (!m_info->elfs.contains(elf))
|
||||
{
|
||||
auto* item = new QListWidgetItem(elf, m_ui->listWidget_elfs);
|
||||
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
||||
item->setCheckState(Qt::Unchecked);
|
||||
}
|
||||
}
|
||||
|
||||
m_ui->listWidget_elfs->sortItems();
|
||||
|
||||
m_ui->test_button->setEnabled(m_process.state() == QProcess::NotRunning && dir_exists);
|
||||
}
|
||||
|
||||
void ConfigurationEditDialog::scan_libs()
|
||||
{
|
||||
QStringList libs = KYTY_LIBS;
|
||||
|
||||
m_ui->listWidget_libs->clear();
|
||||
|
||||
int selected_num = 0;
|
||||
|
||||
for (const auto& lib: m_info->libs)
|
||||
{
|
||||
bool not_enabled = !libs.contains(lib);
|
||||
bool selected = m_info->libs_selected.contains(lib);
|
||||
|
||||
auto* item = new QListWidgetItem(lib, m_ui->listWidget_libs);
|
||||
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
||||
|
||||
if (not_enabled)
|
||||
{
|
||||
item->setCheckState(Qt::Unchecked);
|
||||
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
|
||||
} else
|
||||
{
|
||||
item->setCheckState(selected ? Qt::Checked : Qt::Unchecked);
|
||||
}
|
||||
|
||||
selected_num += (selected ? 1 : 0);
|
||||
}
|
||||
|
||||
for (const auto& lib: libs)
|
||||
{
|
||||
if (!m_info->libs.contains(lib))
|
||||
{
|
||||
auto* item = new QListWidgetItem(lib, m_ui->listWidget_libs);
|
||||
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
||||
item->setCheckState(Qt::Unchecked);
|
||||
}
|
||||
}
|
||||
|
||||
m_ui->listWidget_libs->sortItems();
|
||||
}
|
||||
|
||||
void ConfigurationEditDialog::clear()
|
||||
{
|
||||
auto* old_info = m_info;
|
||||
|
||||
m_info = new Kyty::Configuration;
|
||||
Init();
|
||||
delete m_info;
|
||||
|
||||
m_info = old_info;
|
||||
|
||||
scan_elfs();
|
||||
scan_libs();
|
||||
}
|
||||
|
||||
void ConfigurationEditDialog::test()
|
||||
{
|
||||
m_ui->test_button->setEnabled(false);
|
||||
|
||||
auto* info = new Kyty::Configuration;
|
||||
|
||||
UpdateInfo(info, m_ui);
|
||||
|
||||
m_parent->GetMainDialog()->RunInterpreter(&m_process, info, false);
|
||||
|
||||
delete info;
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
#include "ConfigurationItem.h"
|
||||
|
||||
#include "Configuration.h"
|
||||
|
||||
#include <QFont>
|
||||
#include <QIcon>
|
||||
#include <QSize>
|
||||
|
||||
ConfigurationItem::ConfigurationItem(Kyty::Configuration* info, QListWidget* parent): QListWidgetItem(parent), m_info(info)
|
||||
{
|
||||
setSizeHint(QSize(0, 18));
|
||||
if (m_info != nullptr)
|
||||
{
|
||||
setText(m_info->Name);
|
||||
}
|
||||
SetRunning(false);
|
||||
}
|
||||
|
||||
ConfigurationItem::~ConfigurationItem()
|
||||
{
|
||||
delete m_info;
|
||||
}
|
||||
|
||||
void ConfigurationItem::Update()
|
||||
{
|
||||
if (m_info != nullptr)
|
||||
{
|
||||
setText(m_info->Name);
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigurationItem::SetRunning(bool state)
|
||||
{
|
||||
m_running = state;
|
||||
|
||||
QFont f = font();
|
||||
f.setBold(state);
|
||||
setFont(f);
|
||||
|
||||
if (m_running)
|
||||
{
|
||||
setIcon(QIcon(":/running"));
|
||||
} else
|
||||
{
|
||||
setIcon(QIcon(":/application"));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,213 @@
|
|||
#include "ConfigurationListWidget.h"
|
||||
|
||||
#include "Common.h"
|
||||
#include "Configuration.h"
|
||||
#include "ConfigurationEditDialog.h"
|
||||
#include "ConfigurationItem.h"
|
||||
#include "MainDialog.h"
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QAbstractItemView>
|
||||
#include <QAction>
|
||||
#include <QCursor>
|
||||
#include <QDialog>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QIcon>
|
||||
#include <QListWidget>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QSettings>
|
||||
#include <QToolButton>
|
||||
#include <QtCore>
|
||||
|
||||
#include "ui_configuration_list_widget.h"
|
||||
|
||||
constexpr char CONF_FILE_NAME[] = "Kyty.ini";
|
||||
constexpr char CONF_ORG_NAME[] = "Kyty";
|
||||
constexpr char CONF_APP_NAME[] = "Kyty";
|
||||
constexpr char CONF_SECTION_NAME[] = "ConfigurationList";
|
||||
|
||||
ConfigurationListWidget::ConfigurationListWidget(QWidget* parent): QWidget(parent), m_ui(new Ui::ConfigurationListWidget)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_ui->delete_button->setEnabled(false);
|
||||
m_ui->edit_button->setEnabled(false);
|
||||
|
||||
m_ui->cfgs_list->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
connect(m_ui->add_button, &QPushButton::clicked, this, &ConfigurationListWidget::add_configuration);
|
||||
connect(m_ui->edit_button, &QPushButton::clicked, this, &ConfigurationListWidget::edit_configuration);
|
||||
connect(m_ui->delete_button, &QPushButton::clicked, this, &ConfigurationListWidget::delete_configuartion);
|
||||
connect(m_ui->cfgs_list, &QListWidget::itemClicked, this, &ConfigurationListWidget::list_itemClicked);
|
||||
connect(m_ui->cfgs_list, &QListWidget::customContextMenuRequested, this, &ConfigurationListWidget::show_context_menu);
|
||||
|
||||
m_ui->cfgs_list->setDragDropMode(QAbstractItemView::InternalMove);
|
||||
connect(m_ui->cfgs_list->model(), &QAbstractItemModel::rowsMoved, this, &ConfigurationListWidget::WriteSettings);
|
||||
|
||||
ReadSettings();
|
||||
}
|
||||
|
||||
ConfigurationListWidget::~ConfigurationListWidget()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void ConfigurationListWidget::WriteSettings()
|
||||
{
|
||||
QSettings* s = nullptr;
|
||||
QFile file(QDir(".").absoluteFilePath(CONF_FILE_NAME));
|
||||
if (file.exists())
|
||||
{
|
||||
s = new QSettings(CONF_FILE_NAME, QSettings::IniFormat);
|
||||
} else
|
||||
{
|
||||
s = new QSettings(QSettings::IniFormat, QSettings::SystemScope, CONF_ORG_NAME, CONF_APP_NAME);
|
||||
}
|
||||
|
||||
if (s != nullptr)
|
||||
{
|
||||
MainDialog::WriteSettings(s);
|
||||
ConfigurationEditDialog::WriteSettings(s);
|
||||
|
||||
s->remove(CONF_SECTION_NAME);
|
||||
s->beginWriteArray(CONF_SECTION_NAME);
|
||||
for (int i = 0; i < m_ui->cfgs_list->count(); i++)
|
||||
{
|
||||
auto* item = static_cast<ConfigurationItem*>(m_ui->cfgs_list->item(i));
|
||||
s->setArrayIndex(i);
|
||||
item->GetInfo()->WriteSettings(s);
|
||||
}
|
||||
s->endArray();
|
||||
}
|
||||
|
||||
delete s;
|
||||
}
|
||||
|
||||
void ConfigurationListWidget::ReadSettings()
|
||||
{
|
||||
QSettings* s = nullptr;
|
||||
QFile file(QDir(".").absoluteFilePath(CONF_FILE_NAME));
|
||||
if (file.exists())
|
||||
{
|
||||
s = new QSettings(CONF_FILE_NAME, QSettings::IniFormat);
|
||||
} else
|
||||
{
|
||||
s = new QSettings(QSettings::IniFormat, QSettings::SystemScope, CONF_ORG_NAME, CONF_APP_NAME);
|
||||
}
|
||||
|
||||
if (s != nullptr)
|
||||
{
|
||||
m_settings_file = s->fileName();
|
||||
|
||||
MainDialog::ReadSettings(s);
|
||||
ConfigurationEditDialog::ReadSettings(s);
|
||||
|
||||
int size = s->beginReadArray(CONF_SECTION_NAME);
|
||||
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
s->setArrayIndex(i);
|
||||
auto* info = new Kyty::Configuration;
|
||||
info->ReadSettings(s);
|
||||
new ConfigurationItem(info, m_ui->cfgs_list);
|
||||
}
|
||||
s->endArray();
|
||||
}
|
||||
|
||||
delete s;
|
||||
}
|
||||
|
||||
void ConfigurationListWidget::add_configuration()
|
||||
{
|
||||
auto* info = new Kyty::Configuration;
|
||||
|
||||
ConfigurationEditDialog dlg(info, this);
|
||||
dlg.SetTitle(tr("New configuration"));
|
||||
|
||||
if (dlg.exec() == QDialog::Accepted)
|
||||
{
|
||||
new ConfigurationItem(info, m_ui->cfgs_list);
|
||||
WriteSettings();
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigurationListWidget::edit_configuration()
|
||||
{
|
||||
auto* item = static_cast<ConfigurationItem*>(m_ui->cfgs_list->currentItem());
|
||||
|
||||
ConfigurationEditDialog dlg(item->GetInfo(), this);
|
||||
dlg.SetTitle(tr("Edit configuration"));
|
||||
|
||||
if (dlg.exec() == QDialog::Accepted)
|
||||
{
|
||||
WriteSettings();
|
||||
item->Update();
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigurationListWidget::delete_configuartion()
|
||||
{
|
||||
if (QMessageBox::Yes == QMessageBox::question(this, tr("Delete configuration"), tr("Do you want to delete configuration?")))
|
||||
{
|
||||
auto* item = static_cast<ConfigurationItem*>(m_ui->cfgs_list->takeItem(m_ui->cfgs_list->currentRow()));
|
||||
delete item;
|
||||
WriteSettings();
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigurationListWidget::run_configuration()
|
||||
{
|
||||
emit Run();
|
||||
}
|
||||
|
||||
void ConfigurationListWidget::list_itemClicked(QListWidgetItem* witem)
|
||||
{
|
||||
auto* item = static_cast<ConfigurationItem*>(witem);
|
||||
|
||||
m_ui->delete_button->setEnabled(!item->IsRunning());
|
||||
m_ui->edit_button->setEnabled(!item->IsRunning());
|
||||
|
||||
m_selected_item = item;
|
||||
|
||||
emit Select();
|
||||
}
|
||||
|
||||
void ConfigurationListWidget::show_context_menu(const QPoint& pos)
|
||||
{
|
||||
auto* item = static_cast<ConfigurationItem*>(m_ui->cfgs_list->itemAt(pos));
|
||||
|
||||
if (item != nullptr)
|
||||
{
|
||||
list_itemClicked(item);
|
||||
}
|
||||
|
||||
QMenu menu;
|
||||
|
||||
QAction* action_run = menu.addAction(tr("Run"), this, SLOT(run_configuration()));
|
||||
menu.addSeparator();
|
||||
/*QAction *action_new = */ menu.addAction(QIcon(":/add"), tr("New..."), this, SLOT(add_configuration()));
|
||||
QAction* action_edit = menu.addAction(QIcon(":/edit"), tr("Edit..."), this, SLOT(edit_configuration()));
|
||||
QAction* action_delete = menu.addAction(QIcon(":/delete"), tr("Delete"), this, SLOT(delete_configuartion()));
|
||||
|
||||
if (item != nullptr)
|
||||
{
|
||||
action_run->setDisabled(item->IsRunning());
|
||||
action_edit->setDisabled(item->IsRunning());
|
||||
action_delete->setDisabled(item->IsRunning());
|
||||
} else
|
||||
{
|
||||
action_run->setDisabled(true);
|
||||
action_edit->setDisabled(true);
|
||||
action_delete->setDisabled(true);
|
||||
}
|
||||
|
||||
if (!m_run_enabled)
|
||||
{
|
||||
action_run->setDisabled(true);
|
||||
}
|
||||
|
||||
menu.exec(QCursor::pos());
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
#include "MainDialog.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QArgument>
|
||||
#include <QObject>
|
||||
#include <QStyleFactory>
|
||||
|
||||
class QStyle;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
MainDialog w;
|
||||
|
||||
QStyle* s = QStyleFactory::create("fusion");
|
||||
QApplication::setStyle(s);
|
||||
|
||||
QObject::connect(&a, &QApplication::aboutToQuit, &w, &MainDialog::Quit);
|
||||
|
||||
w.emit Start();
|
||||
|
||||
w.show();
|
||||
|
||||
return QApplication::exec();
|
||||
}
|
|
@ -0,0 +1,367 @@
|
|||
#include "MainDialog.h"
|
||||
|
||||
#include "Common.h"
|
||||
#include "Configuration.h"
|
||||
#include "ConfigurationItem.h"
|
||||
#include "ConfigurationListWidget.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QByteArray>
|
||||
#include <QDialog>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QIODevice>
|
||||
#include <QLabel>
|
||||
#include <QMessageBox>
|
||||
#include <QProcess>
|
||||
#include <QPushButton>
|
||||
#include <QRadioButton>
|
||||
#include <QRegExp>
|
||||
#include <QSettings>
|
||||
#include <QStringList>
|
||||
#include <QTextStream>
|
||||
#include <QVariant>
|
||||
#include <Q_STARTUPINFO>
|
||||
#include <QtCore>
|
||||
|
||||
#include "ui_main_dialog.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
// IWYU pragma: no_include <minwindef.h>
|
||||
// IWYU pragma: no_include <processthreadsapi.h>
|
||||
|
||||
class QWidget;
|
||||
|
||||
constexpr char SCRIPT_EXE[] = "fc_script.exe";
|
||||
constexpr char CMD_EXE[] = "cmd.exe";
|
||||
constexpr char CONEMU_EXE[] = "C:/Program Files/ConEmu/ConEmu64.exe";
|
||||
constexpr char KYTY_MOUNT[] = "kyty_mount";
|
||||
constexpr char KYTY_EXECUTE[] = "kyty_execute";
|
||||
constexpr char KYTY_LOAD_ELF[] = "kyty_load_elf";
|
||||
constexpr char KYTY_LOAD_SYMBOLS[] = "kyty_load_symbols";
|
||||
constexpr char KYTY_INIT[] = "kyty_init";
|
||||
constexpr char KYTY_LUA_FILE[] = "kyty_run.lua";
|
||||
constexpr DWORD CMD_X_CHARS = 175;
|
||||
constexpr DWORD CMD_Y_CHARS = 1000;
|
||||
constexpr char SETTINGS_MAIN_DIALOG[] = "MainDialog";
|
||||
constexpr char SETTINGS_MAIN_LAST_GEOMETRY[] = "geometry";
|
||||
|
||||
class DetachableProcess: public QProcess
|
||||
{
|
||||
public:
|
||||
explicit DetachableProcess(QObject* parent = nullptr): QProcess(parent) {}
|
||||
void Detach()
|
||||
{
|
||||
this->waitForStarted();
|
||||
setProcessState(QProcess::NotRunning);
|
||||
}
|
||||
};
|
||||
|
||||
class MainDialogPrivate: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
KYTY_QT_CLASS_NO_COPY(MainDialogPrivate);
|
||||
|
||||
public:
|
||||
MainDialogPrivate() = default;
|
||||
~MainDialogPrivate() override;
|
||||
|
||||
void Setup(MainDialog* main_dialog);
|
||||
|
||||
/*slots:*/
|
||||
|
||||
void Update();
|
||||
void FindInterpreter();
|
||||
void Run();
|
||||
|
||||
[[nodiscard]] const QString& GetInterpreter() const { return m_interpreter; }
|
||||
|
||||
static void WriteSettings(QSettings* s);
|
||||
static void ReadSettings(QSettings* s);
|
||||
|
||||
private:
|
||||
static QByteArray g_last_geometry;
|
||||
|
||||
Ui::MainDialog* m_ui = {nullptr};
|
||||
MainDialog* m_main_dialog = nullptr;
|
||||
QString m_interpreter;
|
||||
DetachableProcess m_process;
|
||||
ConfigurationItem* m_running_item = nullptr;
|
||||
};
|
||||
|
||||
QByteArray MainDialogPrivate::g_last_geometry;
|
||||
|
||||
MainDialog::MainDialog(QWidget* parent): QDialog(parent), m_p(new MainDialogPrivate)
|
||||
{
|
||||
m_p->Setup(this);
|
||||
}
|
||||
|
||||
MainDialogPrivate::~MainDialogPrivate()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void MainDialogPrivate::Setup(MainDialog* main_dialog)
|
||||
{
|
||||
m_ui = new Ui::MainDialog;
|
||||
m_ui->setupUi(main_dialog);
|
||||
|
||||
setParent(main_dialog);
|
||||
m_main_dialog = main_dialog;
|
||||
m_ui->widget->SetMainDialog(main_dialog);
|
||||
|
||||
main_dialog->setWindowFlags(Qt::Dialog /*| Qt::MSWindowsFixedSizeDialogHint*/);
|
||||
|
||||
connect(main_dialog, &MainDialog::Start, this, &MainDialogPrivate::FindInterpreter, Qt::QueuedConnection);
|
||||
connect(m_ui->pushButton_Run, &QPushButton::clicked, this, &MainDialogPrivate::Run);
|
||||
connect(m_ui->widget, &ConfigurationListWidget::Select, this, &MainDialogPrivate::Update);
|
||||
connect(m_ui->widget, &ConfigurationListWidget::Run, this, &MainDialogPrivate::Run);
|
||||
connect(main_dialog, &MainDialog::Resize,
|
||||
[=]()
|
||||
{
|
||||
g_last_geometry = m_main_dialog->saveGeometry();
|
||||
m_ui->widget->WriteSettings();
|
||||
});
|
||||
|
||||
connect(&m_process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
||||
[=](int /*exitCode*/, QProcess::ExitStatus /*exitStatus*/)
|
||||
{
|
||||
m_running_item->SetRunning(false);
|
||||
Update();
|
||||
});
|
||||
|
||||
connect(main_dialog, &MainDialog::Quit, [=]() { m_process.Detach(); });
|
||||
|
||||
m_ui->label_settings_file->setText(tr("Settings file: ") + m_ui->widget->GetSettingsFile());
|
||||
|
||||
m_main_dialog->restoreGeometry(g_last_geometry);
|
||||
|
||||
Update();
|
||||
}
|
||||
|
||||
void MainDialogPrivate::FindInterpreter()
|
||||
{
|
||||
QFile file(QDir(".").absoluteFilePath(SCRIPT_EXE));
|
||||
if (file.exists())
|
||||
{
|
||||
m_interpreter = file.fileName();
|
||||
} else
|
||||
{
|
||||
QFile file(QDir("..").absoluteFilePath(SCRIPT_EXE));
|
||||
if (file.exists())
|
||||
{
|
||||
m_interpreter = file.fileName();
|
||||
}
|
||||
}
|
||||
|
||||
bool found = QFile::exists(m_interpreter);
|
||||
|
||||
if (found)
|
||||
{
|
||||
m_ui->label_Interpreter->setText(tr("Emulator: ") + m_interpreter);
|
||||
|
||||
QProcess test;
|
||||
test.setProgram(m_interpreter);
|
||||
test.start();
|
||||
test.waitForFinished();
|
||||
|
||||
auto output = QString(test.readAllStandardOutput());
|
||||
auto lines = output.split(QRegExp("[\r\n]"), Qt::SkipEmptyParts);
|
||||
|
||||
if (lines.count() >= 2)
|
||||
{
|
||||
m_ui->label_Version->setText(tr("Version: ") + (lines.at(0).startsWith("exe_name") ? lines.at(1) : lines.at(0)));
|
||||
} else
|
||||
{
|
||||
found = false;
|
||||
}
|
||||
|
||||
found = found && lines.contains(QString("Lua function: ") + KYTY_MOUNT);
|
||||
found = found && lines.contains(QString("Lua function: ") + KYTY_EXECUTE);
|
||||
found = found && lines.contains(QString("Lua function: ") + KYTY_LOAD_ELF);
|
||||
found = found && lines.contains(QString("Lua function: ") + KYTY_LOAD_SYMBOLS);
|
||||
found = found && lines.contains(QString("Lua function: ") + KYTY_INIT);
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
QMessageBox::critical(m_main_dialog, tr("Error"), tr("Can't find emulator"));
|
||||
QApplication::quit();
|
||||
return;
|
||||
}
|
||||
|
||||
QFile console(CONEMU_EXE);
|
||||
bool con_emu = console.exists();
|
||||
|
||||
m_ui->radioButton_Cmd->setEnabled(true);
|
||||
m_ui->radioButton_Cmd->setChecked(!con_emu);
|
||||
m_ui->radioButton_ConEmu->setEnabled(con_emu);
|
||||
m_ui->radioButton_ConEmu->setChecked(con_emu);
|
||||
|
||||
Update();
|
||||
}
|
||||
|
||||
static bool CreateLuaScript(Kyty::Configuration* info, const QString& file_name)
|
||||
{
|
||||
QFile file(file_name);
|
||||
if (file.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
{
|
||||
QTextStream s(&file);
|
||||
|
||||
auto r = EnumToText(info->screen_resolution).split('x');
|
||||
|
||||
if (r.size() != 2)
|
||||
{
|
||||
file.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
s << "local cfg = {\n";
|
||||
s << "\t ScreenWidth = " << r.at(0) << ";\n";
|
||||
s << "\t ScreenHeight = " << r.at(1) << ";\n";
|
||||
s << "\t Neo = " << (info->neo ? "true" : "false") << ";\n";
|
||||
s << "\t VulkanValidationEnabled = " << (info->vulkan_validation_enabled ? "true" : "false") << ";\n";
|
||||
s << "\t ShaderValidationEnabled = " << (info->shader_validation_enabled ? "true" : "false") << ";\n";
|
||||
s << "\t ShaderOptimizationType = '" << EnumToText(info->shader_optimization_type) << "';\n";
|
||||
s << "\t ShaderLogDirection = '" << EnumToText(info->shader_log_direction) << "';\n";
|
||||
s << "\t ShaderLogFolder = '" << info->shader_log_folder << "';\n";
|
||||
s << "\t CommandBufferDumpEnabled = " << (info->command_buffer_dump_enabled ? "true" : "false") << ";\n";
|
||||
s << "\t CommandBufferDumpFolder = '" << info->command_buffer_dump_folder << "';\n";
|
||||
s << "\t PrintfDirection = '" << EnumToText(info->printf_direction) << "';\n";
|
||||
s << "\t PrintfOutputFile = '" << info->printf_output_file << "';\n";
|
||||
s << "\t ProfilerDirection = '" << EnumToText(info->profiler_direction) << "';\n";
|
||||
s << "\t ProfilerOutputFile = '" << info->profiler_output_file << "';\n";
|
||||
s << "\t SpirvDebugPrintfEnabled = " << (info->spirv_debug_printf_enabled ? "true" : "false") << ";\n";
|
||||
s << "}\n";
|
||||
|
||||
s << KYTY_INIT << "(cfg);\n";
|
||||
s << KYTY_MOUNT << "('" << info->BaseDir << "', '/app0');\n";
|
||||
|
||||
for (const auto& elf: info->elfs_selected)
|
||||
{
|
||||
s << KYTY_LOAD_ELF << "('/app0/" << elf << "');\n";
|
||||
}
|
||||
|
||||
for (const auto& lib: info->libs_selected)
|
||||
{
|
||||
s << KYTY_LOAD_SYMBOLS << "('" << lib << "');\n";
|
||||
}
|
||||
|
||||
s << KYTY_EXECUTE << "();\n";
|
||||
|
||||
file.close();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void MainDialog::RunInterpreter(QProcess* process, Kyty::Configuration* info, bool con_emu)
|
||||
{
|
||||
const auto& interpreter = m_p->GetInterpreter();
|
||||
|
||||
QFileInfo f(interpreter);
|
||||
auto dir = f.absoluteDir();
|
||||
|
||||
auto lua_file_name = dir.filePath(KYTY_LUA_FILE);
|
||||
|
||||
if (!CreateLuaScript(info, lua_file_name))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("Can't create file:\n") + lua_file_name);
|
||||
QApplication::quit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (con_emu)
|
||||
{
|
||||
process->setProgram(CONEMU_EXE);
|
||||
process->setArguments({"-run", /*CMD_EXE, "/K", */ interpreter, lua_file_name});
|
||||
} else
|
||||
{
|
||||
process->setProgram(CMD_EXE);
|
||||
process->setArguments({"/K", interpreter, lua_file_name});
|
||||
}
|
||||
process->setWorkingDirectory(dir.path());
|
||||
process->setCreateProcessArgumentsModifier(
|
||||
[](QProcess::CreateProcessArguments* args)
|
||||
{
|
||||
args->flags |= static_cast<uint32_t>(CREATE_NEW_CONSOLE);
|
||||
args->startupInfo->dwFlags &= ~static_cast<DWORD>(STARTF_USESTDHANDLES);
|
||||
args->startupInfo->dwFlags |= static_cast<DWORD>(STARTF_USECOUNTCHARS);
|
||||
args->startupInfo->dwXCountChars = CMD_X_CHARS;
|
||||
args->startupInfo->dwYCountChars = CMD_Y_CHARS;
|
||||
// args->startupInfo->dwFlags |= static_cast<DWORD>(STARTF_USEFILLATTRIBUTE);
|
||||
// args->startupInfo->dwFillAttribute =
|
||||
// static_cast<DWORD>(BACKGROUND_BLUE) | static_cast<DWORD>(FOREGROUND_RED) | static_cast<DWORD>(FOREGROUND_INTENSITY);
|
||||
});
|
||||
process->start();
|
||||
process->waitForFinished(100);
|
||||
}
|
||||
|
||||
void MainDialog::WriteSettings(QSettings* s)
|
||||
{
|
||||
MainDialogPrivate::WriteSettings(s);
|
||||
}
|
||||
|
||||
void MainDialog::ReadSettings(QSettings* s)
|
||||
{
|
||||
MainDialogPrivate::ReadSettings(s);
|
||||
}
|
||||
|
||||
void MainDialog::resizeEvent(QResizeEvent* event)
|
||||
{
|
||||
emit Resize();
|
||||
QDialog::resizeEvent(event);
|
||||
}
|
||||
|
||||
void MainDialogPrivate::WriteSettings(QSettings* s)
|
||||
{
|
||||
s->beginGroup(SETTINGS_MAIN_DIALOG);
|
||||
|
||||
if (!g_last_geometry.isEmpty())
|
||||
{
|
||||
s->setValue(SETTINGS_MAIN_LAST_GEOMETRY, g_last_geometry);
|
||||
}
|
||||
|
||||
s->endGroup();
|
||||
}
|
||||
|
||||
void MainDialogPrivate::ReadSettings(QSettings* s)
|
||||
{
|
||||
s->beginGroup(SETTINGS_MAIN_DIALOG);
|
||||
|
||||
g_last_geometry = s->value(SETTINGS_MAIN_LAST_GEOMETRY, g_last_geometry).toByteArray();
|
||||
|
||||
s->endGroup();
|
||||
}
|
||||
|
||||
void MainDialogPrivate::Run()
|
||||
{
|
||||
m_running_item = m_ui->widget->GetSelectedItem();
|
||||
|
||||
m_running_item->SetRunning(true);
|
||||
|
||||
m_main_dialog->RunInterpreter(&m_process, m_running_item->GetInfo(), m_ui->radioButton_ConEmu->isChecked());
|
||||
|
||||
Update();
|
||||
}
|
||||
|
||||
void MainDialogPrivate::Update()
|
||||
{
|
||||
const auto* item = m_ui->widget->GetSelectedItem();
|
||||
|
||||
bool run_enabled = (m_process.state() == QProcess::NotRunning && item != nullptr);
|
||||
|
||||
if (run_enabled && item != nullptr)
|
||||
{
|
||||
const auto* info = item->GetInfo();
|
||||
auto dir = info->BaseDir;
|
||||
run_enabled = !dir.isEmpty() && QDir(dir).exists();
|
||||
}
|
||||
|
||||
m_ui->pushButton_Run->setEnabled(run_enabled);
|
||||
m_ui->widget->SetRunEnabled(run_enabled);
|
||||
}
|
||||
|
||||
#include "MainDialog.moc"
|
|
@ -0,0 +1,51 @@
|
|||
#include "MandatoryLineEdit.h"
|
||||
|
||||
#include <QColor>
|
||||
#include <QLine>
|
||||
#include <QPainter>
|
||||
#include <QPen>
|
||||
#include <QVariant>
|
||||
#include <QtCore>
|
||||
|
||||
class QPaintEvent;
|
||||
class QWidget;
|
||||
|
||||
MandatoryLineEdit::MandatoryLineEdit(QWidget* parent): QLineEdit(parent)
|
||||
{
|
||||
this->setProperty(MANDATORY_AND_EMPTY, true);
|
||||
|
||||
connect(this, &QLineEdit::textChanged, this, &MandatoryLineEdit::changed);
|
||||
}
|
||||
|
||||
void MandatoryLineEdit::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
QLineEdit::paintEvent(event);
|
||||
|
||||
if (this->property(MANDATORY_AND_EMPTY).toBool() && this->isEnabled())
|
||||
{
|
||||
QPainter painter(this);
|
||||
QLine line(4, this->height() - 4, this->width() - 4, this->height() - 4);
|
||||
painter.setPen(QPen(QColor(255, 0, 0), 1.0, Qt::DotLine));
|
||||
painter.drawLine(line);
|
||||
}
|
||||
}
|
||||
|
||||
bool MandatoryLineEdit::FindEmpty(QObject* p)
|
||||
{
|
||||
const QList<QLineEdit*>& ch_list = p->findChildren<QLineEdit*>();
|
||||
|
||||
foreach (QLineEdit* ch, ch_list)
|
||||
{
|
||||
if (ch->isVisible() && ch->property(MANDATORY_AND_EMPTY).toBool() && ch->isEnabled())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void MandatoryLineEdit::changed(const QString& text)
|
||||
{
|
||||
this->setProperty(MANDATORY_AND_EMPTY, text.isEmpty());
|
||||
}
|
|
@ -0,0 +1,364 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="ru_RU">
|
||||
<context>
|
||||
<name>ConfigurationEditDialog</name>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="14"/>
|
||||
<source>Dialog</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="43"/>
|
||||
<source>Name:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="50"/>
|
||||
<source><html><head/><body><p>Configuration name</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="84"/>
|
||||
<source>Mount app0 to</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="93"/>
|
||||
<source><html><head/><body><p>Name of the directory where game is located</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="103"/>
|
||||
<source>Browse...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="138"/>
|
||||
<source>Screen resoultion:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="145"/>
|
||||
<source>Window resolution</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="161"/>
|
||||
<source>Enable PS4 Pro mode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="164"/>
|
||||
<source>Neo</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="174"/>
|
||||
<source>Validate SPIR-V binary</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="177"/>
|
||||
<source>Shader validation</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="187"/>
|
||||
<source>Enable Vulkan validation layers</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="190"/>
|
||||
<source>Vulkan validation</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="200"/>
|
||||
<source>Dump command buffers</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="203"/>
|
||||
<source>Command buffer dump</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="216"/>
|
||||
<source>Enable GL_EXT_debug_printf extension</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="219"/>
|
||||
<source>Spirv debug printf</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="229"/>
|
||||
<source>Shader optimization type:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="236"/>
|
||||
<source>Optimize shaders for code size or performance</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="243"/>
|
||||
<source>Dump shaders to file or console window. If enabled may decrease emulator performance</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="250"/>
|
||||
<source>Specify directory to dump shaders</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="260"/>
|
||||
<source>Specify directory to dump command buffers</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="270"/>
|
||||
<source>Print logs to file or console window. If enabled may decrease emulator performance</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="277"/>
|
||||
<source>Specify file to dump logs</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="287"/>
|
||||
<source>Enable/disable profiler. If enabled may decrease emulator performance</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="294"/>
|
||||
<source>Shader log direction:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="301"/>
|
||||
<source>Shader log folder:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="308"/>
|
||||
<source>Command buffer dump folder:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="315"/>
|
||||
<source>Printf direction:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="322"/>
|
||||
<source>Printf output file:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="329"/>
|
||||
<source>Profiler direction:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="336"/>
|
||||
<source>Specify file to dump profiler info</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="346"/>
|
||||
<source>Profiler output file:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="373"/>
|
||||
<source>Load elf:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="380"/>
|
||||
<source>Select executables to load</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="408"/>
|
||||
<source>Select libraries to load</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="418"/>
|
||||
<source>Load library:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="455"/>
|
||||
<source>Save</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="471"/>
|
||||
<source>Cancel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="491"/>
|
||||
<source>Clear</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_edit_dialog.ui" line="507"/>
|
||||
<source>Test</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ConfigurationEditDialog.cpp" line="241"/>
|
||||
<source>Save failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ConfigurationEditDialog.cpp" line="241"/>
|
||||
<source>Please fill all mandatory fields</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ConfigurationEditDialog.cpp" line="254"/>
|
||||
<source>Open Directory</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ConfigurationListWidget</name>
|
||||
<message>
|
||||
<location filename="../forms/configuration_list_widget.ui" line="14"/>
|
||||
<source>Configurations</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_list_widget.ui" line="68"/>
|
||||
<source><html><head/><body><p>New configuration</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_list_widget.ui" line="97"/>
|
||||
<source><html><head/><body><p>Edit configuration</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/configuration_list_widget.ui" line="126"/>
|
||||
<source><html><head/><body><p>Delete configuration</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ConfigurationListWidget.cpp" line="128"/>
|
||||
<source>New configuration</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ConfigurationListWidget.cpp" line="142"/>
|
||||
<source>Edit configuration</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ConfigurationListWidget.cpp" line="153"/>
|
||||
<source>Delete configuration</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ConfigurationListWidget.cpp" line="153"/>
|
||||
<source>Do you want to delete configuration?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ConfigurationListWidget.cpp" line="189"/>
|
||||
<source>Run</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ConfigurationListWidget.cpp" line="191"/>
|
||||
<source>New...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ConfigurationListWidget.cpp" line="192"/>
|
||||
<source>Edit...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ConfigurationListWidget.cpp" line="193"/>
|
||||
<source>Delete</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainDialog</name>
|
||||
<message>
|
||||
<location filename="../forms/main_dialog.ui" line="20"/>
|
||||
<source>Kyty Launcher</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/main_dialog.ui" line="57"/>
|
||||
<location filename="../forms/main_dialog.ui" line="70"/>
|
||||
<location filename="../forms/main_dialog.ui" line="77"/>
|
||||
<source>TextLabel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/main_dialog.ui" line="86"/>
|
||||
<source>Cmd</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/main_dialog.ui" line="96"/>
|
||||
<source>ConEmu</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/main_dialog.ui" line="121"/>
|
||||
<source>Run</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/MainDialog.cpp" line="271"/>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/MainDialog.cpp" line="271"/>
|
||||
<source>Can't create file:
|
||||
</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainDialogPrivate</name>
|
||||
<message>
|
||||
<location filename="../src/MainDialog.cpp" line="137"/>
|
||||
<source>Settings file: </source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/MainDialog.cpp" line="163"/>
|
||||
<source>Emulator: </source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/MainDialog.cpp" line="175"/>
|
||||
<source>Version: </source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/MainDialog.cpp" line="190"/>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/MainDialog.cpp" line="190"/>
|
||||
<source>Can't find emulator</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
File diff suppressed because it is too large
Load Diff
|
@ -11,15 +11,20 @@
|
|||
|
||||
// IWYU pragma: no_include <sec_api/string_s.h>
|
||||
|
||||
#if 0 && (KYTY_COMPILER == KYTY_COMPILER_MSVC || KYTY_COMPILER == KYTY_COMPILER_MINGW)
|
||||
String unDName(const String &mangled,
|
||||
void* (*memget)(size_t), void (*memfree)(void*),
|
||||
unsigned short int flags);
|
||||
#if 1 && (KYTY_COMPILER == KYTY_COMPILER_MSVC || KYTY_LINKER == KYTY_LINKER_LLD_LINK)
|
||||
#define KYTY_UNDECORATE
|
||||
#endif
|
||||
|
||||
#ifdef KYTY_UNDECORATE
|
||||
//String unDName(const String &mangled,
|
||||
// void* (*memget)(size_t), void (*memfree)(void*),
|
||||
// unsigned short int flags);
|
||||
#endif
|
||||
|
||||
namespace Kyty::Core {
|
||||
|
||||
#ifndef KYTY_FINAL
|
||||
//#ifndef KYTY_FINAL
|
||||
#if KYTY_PROJECT != KYTY_PROJECT_BUILD_TOOLS
|
||||
#define DEBUG_MAP_ENABLED
|
||||
#endif
|
||||
|
||||
|
@ -105,9 +110,12 @@ void DebugMap::LoadMap()
|
|||
if (linker == U"ld")
|
||||
{
|
||||
LoadGnuLd(map_file, KYTY_BITNESS);
|
||||
} else if (linker == U"link" || linker == U"lld_link")
|
||||
} else if (linker == U"link")
|
||||
{
|
||||
LoadMsvcLink(map_file, KYTY_BITNESS);
|
||||
} else if (linker == U"lld_link")
|
||||
{
|
||||
LoadMsvcLldLink(map_file, KYTY_BITNESS);
|
||||
} else if (linker == U"lld")
|
||||
{
|
||||
LoadLlvmLld(map_file, KYTY_BITNESS);
|
||||
|
@ -191,7 +199,7 @@ void DebugMap::LoadCsv()
|
|||
|
||||
#endif
|
||||
|
||||
// EXIT("1");
|
||||
//EXIT("1");
|
||||
|
||||
#endif
|
||||
}
|
||||
|
@ -315,46 +323,102 @@ void DebugMap::LoadMsvcLink(const String& name, int mode)
|
|||
}
|
||||
|
||||
// UNDNAME_COMPLETE
|
||||
#if 0 && (KYTY_COMPILER == KYTY_COMPILER_MSVC || KYTY_COMPILER == KYTY_COMPILER_MINGW)
|
||||
if (String(data[i].name).ContainsStr("?"))
|
||||
#ifdef KYTY_UNDECORATE
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void DebugMap::LoadMsvcLldLink(const String& name, int mode)
|
||||
{
|
||||
File pf(name, File::Mode::Read);
|
||||
if (pf.IsInvalid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto* buf = new uint8_t[pf.Size()];
|
||||
pf.Read(buf, pf.Size());
|
||||
File f;
|
||||
f.OpenInMem(buf, pf.Size());
|
||||
f.SetEncoding(File::Encoding::Utf8);
|
||||
|
||||
pf.Close();
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (f.IsEOF())
|
||||
{
|
||||
String n = String(data[i].name).Mid(String(data[i].name).FindIndex("?"));
|
||||
//char name[1024*16];
|
||||
//char name_all[1024*16];
|
||||
//UnDecorateSymbolName(data[i].name.utf8_str().GetData(), name, sizeof(name) - 1, UNDNAME_COMPLETE | UNDNAME_32_BIT_DECODE | UNDNAME_TYPE_ONLY);
|
||||
break;
|
||||
}
|
||||
|
||||
String name = unDName(n, malloc, free, 0x1000);
|
||||
String name_all = unDName(n, malloc, free, 0);
|
||||
String s = f.ReadLine();
|
||||
s = s.RemoveChar(U'\n');
|
||||
|
||||
//UnDecorateSymbolName(n.utf8_str().GetData(), name, sizeof(name) - 1, 0x1000);
|
||||
//UnDecorateSymbolName(n.utf8_str().GetData(), name_all, sizeof(name_all) - 1, 0);
|
||||
StringList list = s.Split(U" ");
|
||||
|
||||
if (name.At(0) == '?' || name_all.At(0) == '?')
|
||||
if (list.Size() == 4 && list[2].StartsWith(U'0'))
|
||||
{
|
||||
uintptr_t addr = (mode == 32 ? list[2].ToUint32(16) : list[2].ToUint64(16));
|
||||
const String func = list.At(1);
|
||||
const String obj = list[3];
|
||||
|
||||
if (DBG_PRINTF)
|
||||
{
|
||||
n = n.Left(n.FindLastIndex("$"));
|
||||
|
||||
name = unDName(n, malloc, free, 0x1000);
|
||||
name_all = unDName(n, malloc, free, 0);
|
||||
|
||||
//UnDecorateSymbolName(n.utf8_str().GetData(), name, sizeof(name) - 1, 0x1000);
|
||||
//UnDecorateSymbolName(n.utf8_str().GetData(), name_all, sizeof(name_all) - 1, 0);
|
||||
printf("%016" PRIx64 "; %s; %s\n", static_cast<uint64_t>(addr), func.utf8_str().GetData(), obj.utf8_str().GetData());
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
//String name_str = String(name);
|
||||
//String name_all_str = String(name_all);
|
||||
DebugFunctionInfo inf = {addr, 0, func.utf8_str(), obj.utf8_str()};
|
||||
|
||||
//if (name_all_str.Contains(name_str))
|
||||
if (m_p->map.Contains(addr))
|
||||
{
|
||||
uint32_t first = name_all.FindIndex("(");
|
||||
uint32_t last = name_all.FindLastIndex(")");
|
||||
//printf("%08x, %u, %u, %s, %s, %s\n", (uint32_t)data[i].addr, first, last, name_str.utf8_str().GetData(), name_all_str.utf8_str().GetData(), n.utf8_str().GetData());
|
||||
data[i].name = (name + name_all.Mid(first, last - first + 1)).utf8_str();
|
||||
}// else
|
||||
//{
|
||||
// data[i].name = String(name_all);
|
||||
//}
|
||||
String name1(m_p->data.At(m_p->map[addr]).name);
|
||||
if (name1.StartsWith(U"_"))
|
||||
{
|
||||
name1 = name1.Mid(1);
|
||||
}
|
||||
// EXIT_IF(data.At(map[addr]).name != func_name);
|
||||
if (name1 != func && !name1.ContainsStr(func) && !func.ContainsStr(name1))
|
||||
{
|
||||
if (DBG_PRINTF)
|
||||
{
|
||||
printf("warning: name1: %s, name2: %s\n", name1.utf8_str().GetData(), func.utf8_str().GetData());
|
||||
}
|
||||
// exit(1);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// if (mem_alloc_obj.Contains(inf.obj, String::CASE_INSENSITIVE)
|
||||
// && func.ContainsAny(mem_alloc_names))
|
||||
// {
|
||||
// inf.is_mem_alloc = true;
|
||||
// }
|
||||
|
||||
m_p->data.Add(inf);
|
||||
m_p->map.Put(addr, m_p->data.Size() - 1);
|
||||
|
||||
} else
|
||||
{
|
||||
EXIT_IF(list.Size() >= 5 && list[0].ContainsStr(U":") && list[3] != U"f");
|
||||
}
|
||||
}
|
||||
|
||||
f.Close();
|
||||
|
||||
DeleteArray(buf);
|
||||
|
||||
m_p->data.Sort(DebugMapSortSwapFunc, &m_p->map);
|
||||
|
||||
for (uint32_t i = 0; i < m_p->data.Size(); i++)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
m_p->data[i - 1].length = m_p->data[i].addr - m_p->data[i - 1].addr;
|
||||
}
|
||||
|
||||
#ifdef KYTY_UNDECORATE
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
#include <thread>
|
||||
#endif
|
||||
|
||||
//#define KYTY_DEBUG_LOCKS
|
||||
|
||||
namespace Kyty::Core {
|
||||
|
||||
#ifdef THREADS_SDL
|
||||
|
@ -65,7 +67,11 @@ struct Mutex::MutexPrivate
|
|||
#ifdef THREADS_SDL
|
||||
SDL_mutex* sdl;
|
||||
#else
|
||||
std::recursive_mutex m_mutex;
|
||||
#ifdef KYTY_DEBUG_LOCKS
|
||||
std::recursive_timed_mutex m_mutex;
|
||||
#else
|
||||
std::recursive_mutex m_mutex;
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -212,9 +218,16 @@ void Mutex::Lock()
|
|||
{
|
||||
#ifdef THREADS_SDL
|
||||
SDL_LockMutex(m_mutex->sdl);
|
||||
#else
|
||||
#ifdef KYTY_DEBUG_LOCKS
|
||||
if (!m_mutex->m_mutex.try_lock_for(std::chrono::seconds(20)))
|
||||
{
|
||||
EXIT("lock timeout!");
|
||||
}
|
||||
#else
|
||||
m_mutex->m_mutex.lock();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Mutex::Unlock()
|
||||
|
@ -260,8 +273,12 @@ void CondVar::Wait(Mutex* mutex)
|
|||
{
|
||||
#ifdef THREADS_SDL
|
||||
SDL_CondWait(m_cond_var->sdl, mutex->m_mutex->sdl);
|
||||
#else
|
||||
#ifdef KYTY_DEBUG_LOCKS
|
||||
std::unique_lock<std::recursive_timed_mutex> cpp_lock(mutex->m_mutex->m_mutex, std::adopt_lock_t());
|
||||
#else
|
||||
std::unique_lock<std::recursive_mutex> cpp_lock(mutex->m_mutex->m_mutex, std::adopt_lock_t());
|
||||
#endif
|
||||
m_cond_var->m_cv.wait(cpp_lock);
|
||||
cpp_lock.release();
|
||||
#endif
|
||||
|
@ -271,8 +288,12 @@ void CondVar::WaitFor(Mutex* mutex, uint32_t micros)
|
|||
{
|
||||
#ifdef THREADS_SDL
|
||||
SDL_CondWaitTimeout(m_cond_var->sdl, mutex->m_mutex->sdl, (micros < 1000 ? 1 : micros / 1000));
|
||||
#else
|
||||
#ifdef KYTY_DEBUG_LOCKS
|
||||
std::unique_lock<std::recursive_timed_mutex> cpp_lock(mutex->m_mutex->m_mutex, std::adopt_lock_t());
|
||||
#else
|
||||
std::unique_lock<std::recursive_mutex> cpp_lock(mutex->m_mutex->m_mutex, std::adopt_lock_t());
|
||||
#endif
|
||||
m_cond_var->m_cv.wait_for(cpp_lock, std::chrono::microseconds(micros));
|
||||
cpp_lock.release();
|
||||
#endif
|
||||
|
|
|
@ -247,10 +247,14 @@ KYTY_SCRIPT_FUNC(map_to_csv_func)
|
|||
{
|
||||
map.LoadMsvcLink(src, 32);
|
||||
map.DumpMap(dst);
|
||||
} else if (mode.EqualNoCase(U"msvc_link_64") || mode.EqualNoCase(U"msvc_lld_link_64"))
|
||||
} else if (mode.EqualNoCase(U"msvc_link_64"))
|
||||
{
|
||||
map.LoadMsvcLink(src, 64);
|
||||
map.DumpMap(dst);
|
||||
} else if (mode.EqualNoCase(U"clang_lld_link_64"))
|
||||
{
|
||||
map.LoadMsvcLldLink(src, 64);
|
||||
map.DumpMap(dst);
|
||||
} else
|
||||
{
|
||||
printf("unknown map: %s\n", mode.C_Str());
|
||||
|
|
|
@ -27,6 +27,18 @@ function(include_what_you_use target dirs)
|
|||
endif()
|
||||
endfunction()
|
||||
|
||||
function(include_what_you_use_with_mappings target dirs mappings)
|
||||
if (CLANG AND ("${target}" IN_LIST KYTY_IWYU))
|
||||
find_program (CLANG_IWYU_EXE NAMES "include-what-you-use")
|
||||
if (CLANG_IWYU_EXE)
|
||||
foreach(map ${mappings})
|
||||
list(APPEND mapdirs ";-Xiwyu;--mapping_file=${map}")
|
||||
endforeach()
|
||||
set_target_properties(${target} PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${CLANG_IWYU_EXE};${mapdirs};-Xiwyu;--cxx17ns;-Qunused-arguments;-Werror")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(clang_tidy_check target config headers dirs)
|
||||
if (CLANG AND ("${target}" IN_LIST KYTY_CLANG_TYDY) AND NOT MSVC)
|
||||
find_program (CLANG_TIDY_EXE NAMES "clang-tidy")
|
||||
|
|
Loading…
Reference in New Issue