Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Update #1006

Merged
merged 18 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/windows-qt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: shadps4-win64-qt-${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.shorthash }}
path: upload
path: upload
4 changes: 2 additions & 2 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Files: CMakeSettings.json
.github/shadps4.png
.gitmodules
documents/changelog.txt
documents/readme.txt
documents/Quickstart/1.png
documents/Quickstart/2.png
documents/Screenshots/Bloodborne.png
documents/Screenshots/Sonic Mania.png
Expand All @@ -17,6 +15,7 @@ Files: CMakeSettings.json
scripts/ps4_names.txt
src/images/about_icon.png
src/images/controller_icon.png
src/images/dump_icon.png
src/images/exit_icon.png
src/images/file_icon.png
src/images/flag_china.png
Expand All @@ -38,6 +37,7 @@ Files: CMakeSettings.json
src/images/shadPS4.icns
src/images/shadps4.ico
src/images/themes_icon.png
src/images/update_icon.png
src/shadps4.qrc
src/shadps4.rc
Copyright: shadPS4 Emulator Project
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ include(GetGitRevisionDescription)
get_git_head_revision(GIT_REF_SPEC GIT_REV)
git_describe(GIT_DESC --always --long --dirty)
git_branch_name(GIT_BRANCH)
string(TIMESTAMP BUILD_DATE "%Y-%m-%d %H:%M:%S")

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/common/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/src/common/scm_rev.cpp" @ONLY)

Expand Down Expand Up @@ -648,6 +649,8 @@ set(QT_GUI src/qt_gui/about_dialog.cpp
src/qt_gui/about_dialog.ui
src/qt_gui/cheats_patches.cpp
src/qt_gui/cheats_patches.h
src/qt_gui/checkUpdate.cpp
src/qt_gui/checkUpdate.h
src/qt_gui/main_window_ui.h
src/qt_gui/main_window.cpp
src/qt_gui/main_window.h
Expand Down Expand Up @@ -822,4 +825,4 @@ if (UNIX AND NOT APPLE)
find_package(OpenSSL REQUIRED)
target_link_libraries(shadps4 PRIVATE ${OPENSSL_LIBRARIES})
endif()
endif()
endif()
26 changes: 25 additions & 1 deletion src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ static s32 gpuId = -1; // Vulkan physical device index. Set to negative for auto
static std::string logFilter;
static std::string logType = "async";
static std::string userName = "shadPS4";
static std::string updateChannel = "stable";
static bool useSpecialPad = false;
static int specialPadClass = 1;
static bool isDebugDump = false;
static bool isShowSplash = false;
static bool isAutoUpdate = false;
static bool isNullGpu = false;
static bool shouldCopyGPUBuffers = false;
static bool shouldDumpShaders = false;
Expand Down Expand Up @@ -86,6 +88,10 @@ std::string getUserName() {
return userName;
}

std::string getUpdateChannel() {
return updateChannel;
}

bool getUseSpecialPad() {
return useSpecialPad;
}
Expand All @@ -102,6 +108,10 @@ bool showSplash() {
return isShowSplash;
}

bool autoUpdate() {
return isAutoUpdate;
}

bool nullGpu() {
return isNullGpu;
}
Expand Down Expand Up @@ -170,6 +180,10 @@ void setShowSplash(bool enable) {
isShowSplash = enable;
}

void setAutoUpdate(bool enable) {
isAutoUpdate = enable;
}

void setNullGpu(bool enable) {
isNullGpu = enable;
}
Expand Down Expand Up @@ -226,6 +240,10 @@ void setUserName(const std::string& type) {
userName = type;
}

void setUpdateChannel(const std::string& type) {
updateChannel = type;
}

void setUseSpecialPad(bool use) {
useSpecialPad = use;
}
Expand Down Expand Up @@ -364,7 +382,9 @@ void load(const std::filesystem::path& path) {
logFilter = toml::find_or<std::string>(general, "logFilter", "");
logType = toml::find_or<std::string>(general, "logType", "sync");
userName = toml::find_or<std::string>(general, "userName", "shadPS4");
updateChannel = toml::find_or<std::string>(general, "updateChannel", "stable");
isShowSplash = toml::find_or<bool>(general, "showSplash", true);
isAutoUpdate = toml::find_or<bool>(general, "autoUpdate", false);
}

if (data.contains("Input")) {
Expand Down Expand Up @@ -456,7 +476,9 @@ void save(const std::filesystem::path& path) {
data["General"]["logFilter"] = logFilter;
data["General"]["logType"] = logType;
data["General"]["userName"] = userName;
data["General"]["updateChannel"] = updateChannel;
data["General"]["showSplash"] = isShowSplash;
data["General"]["autoUpdate"] = isAutoUpdate;
data["Input"]["useSpecialPad"] = useSpecialPad;
data["Input"]["specialPadClass"] = specialPadClass;
data["GPU"]["screenWidth"] = screenWidth;
Expand Down Expand Up @@ -507,10 +529,12 @@ void setDefaultValues() {
logFilter = "";
logType = "async";
userName = "shadPS4";
updateChannel = "stable";
useSpecialPad = false;
specialPadClass = 1;
isDebugDump = false;
isShowSplash = false;
isAutoUpdate = false;
isNullGpu = false;
shouldDumpShaders = false;
shouldDumpPM4 = false;
Expand All @@ -526,4 +550,4 @@ void setDefaultValues() {
gpuId = -1;
}

} // namespace Config
} // namespace Config
4 changes: 4 additions & 0 deletions src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ bool isFullscreenMode();
std::string getLogFilter();
std::string getLogType();
std::string getUserName();
std::string getUpdateChannel();

bool getUseSpecialPad();
int getSpecialPadClass();
Expand All @@ -26,6 +27,7 @@ s32 getGpuId();

bool debugDump();
bool showSplash();
bool autoUpdate();
bool nullGpu();
bool copyGPUCmdBuffers();
bool dumpShaders();
Expand All @@ -35,6 +37,7 @@ u32 vblankDiv();

void setDebugDump(bool enable);
void setShowSplash(bool enable);
void setAutoUpdate(bool enable);
void setNullGpu(bool enable);
void setCopyGPUCmdBuffers(bool enable);
void setDumpShaders(bool enable);
Expand All @@ -47,6 +50,7 @@ void setFullscreenMode(bool enable);
void setLanguage(u32 language);
void setNeoMode(bool enable);
void setUserName(const std::string& type);
void setUpdateChannel(const std::string& type);

void setUseSpecialPad(bool use);
void setSpecialPadClass(int type);
Expand Down
2 changes: 2 additions & 0 deletions src/common/scm_rev.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
#define GIT_REV "@GIT_REV@"
#define GIT_BRANCH "@GIT_BRANCH@"
#define GIT_DESC "@GIT_DESC@"
#define BUILD_DATE "@BUILD_DATE@"
DanielSvoboda marked this conversation as resolved.
Show resolved Hide resolved

namespace Common {

const char g_scm_rev[] = GIT_REV;
const char g_scm_branch[] = GIT_BRANCH;
const char g_scm_desc[] = GIT_DESC;
const char g_scm_date[] = BUILD_DATE;

} // namespace

1 change: 1 addition & 0 deletions src/common/scm_rev.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ namespace Common {
extern const char g_scm_rev[];
extern const char g_scm_branch[];
extern const char g_scm_desc[];
extern const char g_scm_date[];

} // namespace Common
Binary file added src/images/dump_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/update_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading