Merge branch 'shadps4-emu:main' into main

This commit is contained in:
menaman123 2024-08-15 08:40:55 -04:00 committed by GitHub
commit effd813b93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 75 additions and 31 deletions

View File

@ -107,7 +107,7 @@ if(ENABLE_QT_GUI)
set(CMAKE_AUTOUIC ON)
endif()
set(AUDIO_CORE src/audio_core/sdl_audio.cpp
set(AUDIO_CORE src/audio_core/sdl_audio.cpp
src/audio_core/sdl_audio.h
)
@ -527,34 +527,33 @@ set(EMULATOR src/emulator.cpp
if(ENABLE_QT_GUI)
qt_add_resources(RESOURCE_FILES src/shadps4.qrc)
set(QT_GUI
src/qt_gui/main_window_ui.h
src/qt_gui/main_window.cpp
src/qt_gui/main_window.h
src/qt_gui/gui_context_menus.h
src/qt_gui/game_list_utils.h
src/qt_gui/game_info.cpp
src/qt_gui/game_info.h
src/qt_gui/game_list_frame.cpp
src/qt_gui/game_list_frame.h
src/qt_gui/game_grid_frame.cpp
src/qt_gui/game_grid_frame.h
src/qt_gui/game_install_dialog.cpp
src/qt_gui/game_install_dialog.h
src/qt_gui/pkg_viewer.cpp
src/qt_gui/pkg_viewer.h
src/qt_gui/trophy_viewer.cpp
src/qt_gui/trophy_viewer.h
src/qt_gui/elf_viewer.cpp
src/qt_gui/elf_viewer.h
src/qt_gui/main_window_themes.cpp
src/qt_gui/main_window_themes.h
src/qt_gui/settings_dialog.cpp
src/qt_gui/settings_dialog.h
src/qt_gui/settings_dialog.ui
src/qt_gui/main.cpp
${EMULATOR}
${RESOURCE_FILES}
set(QT_GUI src/qt_gui/main_window_ui.h
src/qt_gui/main_window.cpp
src/qt_gui/main_window.h
src/qt_gui/gui_context_menus.h
src/qt_gui/game_list_utils.h
src/qt_gui/game_info.cpp
src/qt_gui/game_info.h
src/qt_gui/game_list_frame.cpp
src/qt_gui/game_list_frame.h
src/qt_gui/game_grid_frame.cpp
src/qt_gui/game_grid_frame.h
src/qt_gui/game_install_dialog.cpp
src/qt_gui/game_install_dialog.h
src/qt_gui/pkg_viewer.cpp
src/qt_gui/pkg_viewer.h
src/qt_gui/trophy_viewer.cpp
src/qt_gui/trophy_viewer.h
src/qt_gui/elf_viewer.cpp
src/qt_gui/elf_viewer.h
src/qt_gui/main_window_themes.cpp
src/qt_gui/main_window_themes.h
src/qt_gui/settings_dialog.cpp
src/qt_gui/settings_dialog.h
src/qt_gui/settings_dialog.ui
src/qt_gui/main.cpp
${EMULATOR}
${RESOURCE_FILES}
)
endif()

View File

@ -16,6 +16,7 @@ static u32 screenHeight = 720;
static s32 gpuId = -1; // Vulkan physical device index. Set to negative for auto select
static std::string logFilter;
static std::string logType = "async";
static std::string userName = "shadPS4";
static bool isDebugDump = false;
static bool isLibc = true;
static bool isShowSplash = false;
@ -80,6 +81,10 @@ std::string getLogType() {
return logType;
}
std::string getUserName() {
return userName;
}
bool debugDump() {
return isDebugDump;
}
@ -192,6 +197,10 @@ void setLogFilter(std::string type) {
logFilter = type;
}
void setUserName(std::string type) {
userName = type;
}
void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h) {
main_window_geometry_x = x;
main_window_geometry_y = y;
@ -313,6 +322,7 @@ void load(const std::filesystem::path& path) {
isFullscreen = toml::find_or<bool>(general, "Fullscreen", false);
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");
isShowSplash = toml::find_or<bool>(general, "showSplash", true);
}
@ -400,6 +410,7 @@ void save(const std::filesystem::path& path) {
data["General"]["Fullscreen"] = isFullscreen;
data["General"]["logFilter"] = logFilter;
data["General"]["logType"] = logType;
data["General"]["userName"] = userName;
data["General"]["showSplash"] = isShowSplash;
data["GPU"]["screenWidth"] = screenWidth;
data["GPU"]["screenHeight"] = screenHeight;
@ -446,6 +457,7 @@ void setDefaultValues() {
screenHeight = 720;
logFilter = "";
logType = "async";
userName = "shadPS4";
isDebugDump = false;
isShowSplash = false;
isNullGpu = false;

View File

@ -15,6 +15,7 @@ bool isNeoMode();
bool isFullscreenMode();
std::string getLogFilter();
std::string getLogType();
std::string getUserName();
u32 getScreenWidth();
u32 getScreenHeight();
@ -42,6 +43,7 @@ void setScreenHeight(u32 height);
void setFullscreenMode(bool enable);
void setLanguage(u32 language);
void setNeoMode(bool enable);
void setUserName(std::string type);
void setLogType(std::string type);
void setLogFilter(std::string type);

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
// Generated By moduleGenerator
#include "common/config.h"
#include "common/logging/log.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/libs.h"
@ -977,7 +978,7 @@ int PS4_SYSV_ABI sceNpGetGamePresenceStatusA() {
int PS4_SYSV_ABI sceNpGetNpId(OrbisUserServiceUserId userId, OrbisNpId* npId) {
LOG_ERROR(Lib_NpManager, "(DUMMY) called");
std::string name = "shadps4";
std::string name = Config::getUserName();
strcpy(npId->handle.data, name.c_str());
return ORBIS_OK;
}

View File

@ -10,6 +10,7 @@
#include "common/ntapi.h"
#include "common/path_util.h"
#include "common/polyfill_thread.h"
#include "common/scm_rev.h"
#include "common/singleton.h"
#include "common/version.h"
#include "core/file_format/playgo_chunk.h"
@ -26,7 +27,6 @@
#include "core/linker.h"
#include "core/memory.h"
#include "emulator.h"
#include "src/common/scm_rev.h"
#include "video_core/renderdoc.h"
Frontend::WindowSDL* g_window = nullptr;

View File

@ -43,6 +43,9 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
{
connect(ui->consoleLanguageComboBox, &QComboBox::currentIndexChanged, this,
[](int index) { Config::setLanguage(index); });
connect(ui->userNameLineEdit, &QLineEdit::textChanged, this,
[](const QString& text) { Config::setUserName(text.toStdString()); });
}
// GPU TAB
@ -121,6 +124,7 @@ void SettingsDialog::LoadValuesFromConfig() {
ui->ps4proCheckBox->setChecked(Config::isNeoMode());
ui->logTypeComboBox->setCurrentText(QString::fromStdString(Config::getLogType()));
ui->logFilterLineEdit->setText(QString::fromStdString(Config::getLogFilter()));
ui->userNameLineEdit->setText(QString::fromStdString(Config::getUserName()));
ui->debugDump->setChecked(Config::debugDump());
ui->vkValidationCheckBox->setChecked(Config::vkValidationEnabled());

View File

@ -231,6 +231,32 @@
</layout>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="vLayoutUserName">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="hLayoutUserName">
<item>
<widget class="QGroupBox" name="userName">
<property name="title">
<string>Username</string>
</property>
<layout class="QVBoxLayout" name="userNameLayout">
<item>
<widget class="QLineEdit" name="userNameLineEdit"/>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QWidget" name="widgetSettingsTop" native="true">
<layout class="QHBoxLayout" name="widgetGpuTopLayout">