mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-12 04:35:56 +00:00
video_out: Internal Resolution Support (#3194)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
* impl * clang * clang+ * update total_entries too
This commit is contained in:
parent
7fedbd52e0
commit
80f7ec2681
5 changed files with 56 additions and 25 deletions
|
@ -60,8 +60,10 @@ static bool overrideControllerColor = false;
|
||||||
static int controllerCustomColorRGB[3] = {0, 0, 255};
|
static int controllerCustomColorRGB[3] = {0, 0, 255};
|
||||||
|
|
||||||
// GPU
|
// GPU
|
||||||
static u32 screenWidth = 1280;
|
static u32 windowWidth = 1280;
|
||||||
static u32 screenHeight = 720;
|
static u32 windowHeight = 720;
|
||||||
|
static u32 internalScreenWidth = 1280;
|
||||||
|
static u32 internalScreenHeight = 720;
|
||||||
static bool isNullGpu = false;
|
static bool isNullGpu = false;
|
||||||
static bool shouldCopyGPUBuffers = false;
|
static bool shouldCopyGPUBuffers = false;
|
||||||
static bool readbacksEnabled = false;
|
static bool readbacksEnabled = false;
|
||||||
|
@ -104,7 +106,7 @@ u32 m_language = 1; // english
|
||||||
static std::string trophyKey = "";
|
static std::string trophyKey = "";
|
||||||
|
|
||||||
// Expected number of items in the config file
|
// Expected number of items in the config file
|
||||||
static constexpr u64 total_entries = 52;
|
static constexpr u64 total_entries = 54;
|
||||||
|
|
||||||
bool allowHDR() {
|
bool allowHDR() {
|
||||||
return isHDRAllowed;
|
return isHDRAllowed;
|
||||||
|
@ -195,12 +197,20 @@ double getTrophyNotificationDuration() {
|
||||||
return trophyNotificationDuration;
|
return trophyNotificationDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 getScreenWidth() {
|
u32 getWindowWidth() {
|
||||||
return screenWidth;
|
return windowWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 getScreenHeight() {
|
u32 getWindowHeight() {
|
||||||
return screenHeight;
|
return windowHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 getInternalScreenWidth() {
|
||||||
|
return internalScreenHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 getInternalScreenHeight() {
|
||||||
|
return internalScreenHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 getGpuId() {
|
s32 getGpuId() {
|
||||||
|
@ -339,12 +349,20 @@ void setGpuId(s32 selectedGpuId) {
|
||||||
gpuId = selectedGpuId;
|
gpuId = selectedGpuId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setScreenWidth(u32 width) {
|
void setWindowWidth(u32 width) {
|
||||||
screenWidth = width;
|
windowWidth = width;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setScreenHeight(u32 height) {
|
void setWindowHeight(u32 height) {
|
||||||
screenHeight = height;
|
windowHeight = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setInternalScreenWidth(u32 width) {
|
||||||
|
internalScreenWidth = width;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setInternalScreenHeight(u32 height) {
|
||||||
|
internalScreenHeight = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDebugDump(bool enable) {
|
void setDebugDump(bool enable) {
|
||||||
|
@ -426,6 +444,7 @@ void setCursorState(s16 newCursorState) {
|
||||||
void setCursorHideTimeout(int newcursorHideTimeout) {
|
void setCursorHideTimeout(int newcursorHideTimeout) {
|
||||||
cursorHideTimeout = newcursorHideTimeout;
|
cursorHideTimeout = newcursorHideTimeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTrophyNotificationDuration(double newTrophyNotificationDuration) {
|
void setTrophyNotificationDuration(double newTrophyNotificationDuration) {
|
||||||
trophyNotificationDuration = newTrophyNotificationDuration;
|
trophyNotificationDuration = newTrophyNotificationDuration;
|
||||||
}
|
}
|
||||||
|
@ -631,8 +650,11 @@ void load(const std::filesystem::path& path) {
|
||||||
if (data.contains("GPU")) {
|
if (data.contains("GPU")) {
|
||||||
const toml::value& gpu = data.at("GPU");
|
const toml::value& gpu = data.at("GPU");
|
||||||
|
|
||||||
screenWidth = toml::find_or<int>(gpu, "screenWidth", screenWidth);
|
windowWidth = toml::find_or<int>(gpu, "screenWidth", windowWidth);
|
||||||
screenHeight = toml::find_or<int>(gpu, "screenHeight", screenHeight);
|
windowHeight = toml::find_or<int>(gpu, "screenHeight", windowHeight);
|
||||||
|
internalScreenWidth = toml::find_or<int>(gpu, "internalScreenWidth", internalScreenWidth);
|
||||||
|
internalScreenHeight =
|
||||||
|
toml::find_or<int>(gpu, "internalScreenHeight", internalScreenHeight);
|
||||||
isNullGpu = toml::find_or<bool>(gpu, "nullGpu", isNullGpu);
|
isNullGpu = toml::find_or<bool>(gpu, "nullGpu", isNullGpu);
|
||||||
shouldCopyGPUBuffers = toml::find_or<bool>(gpu, "copyGPUBuffers", shouldCopyGPUBuffers);
|
shouldCopyGPUBuffers = toml::find_or<bool>(gpu, "copyGPUBuffers", shouldCopyGPUBuffers);
|
||||||
readbacksEnabled = toml::find_or<bool>(gpu, "readbacks", readbacksEnabled);
|
readbacksEnabled = toml::find_or<bool>(gpu, "readbacks", readbacksEnabled);
|
||||||
|
@ -804,8 +826,10 @@ void save(const std::filesystem::path& path) {
|
||||||
data["Input"]["specialPadClass"] = specialPadClass;
|
data["Input"]["specialPadClass"] = specialPadClass;
|
||||||
data["Input"]["isMotionControlsEnabled"] = isMotionControlsEnabled;
|
data["Input"]["isMotionControlsEnabled"] = isMotionControlsEnabled;
|
||||||
data["Input"]["useUnifiedInputConfig"] = useUnifiedInputConfig;
|
data["Input"]["useUnifiedInputConfig"] = useUnifiedInputConfig;
|
||||||
data["GPU"]["screenWidth"] = screenWidth;
|
data["GPU"]["screenWidth"] = windowWidth;
|
||||||
data["GPU"]["screenHeight"] = screenHeight;
|
data["GPU"]["screenHeight"] = windowHeight;
|
||||||
|
data["GPU"]["internalScreenWidth"] = internalScreenWidth;
|
||||||
|
data["GPU"]["internalScreenHeight"] = internalScreenHeight;
|
||||||
data["GPU"]["nullGpu"] = isNullGpu;
|
data["GPU"]["nullGpu"] = isNullGpu;
|
||||||
data["GPU"]["copyGPUBuffers"] = shouldCopyGPUBuffers;
|
data["GPU"]["copyGPUBuffers"] = shouldCopyGPUBuffers;
|
||||||
data["GPU"]["readbacks"] = readbacksEnabled;
|
data["GPU"]["readbacks"] = readbacksEnabled;
|
||||||
|
@ -905,8 +929,10 @@ void setDefaultValues() {
|
||||||
controllerCustomColorRGB[2] = 255;
|
controllerCustomColorRGB[2] = 255;
|
||||||
|
|
||||||
// GPU
|
// GPU
|
||||||
screenWidth = 1280;
|
windowWidth = 1280;
|
||||||
screenHeight = 720;
|
windowHeight = 720;
|
||||||
|
internalScreenWidth = 1280;
|
||||||
|
internalScreenHeight = 720;
|
||||||
isNullGpu = false;
|
isNullGpu = false;
|
||||||
shouldCopyGPUBuffers = false;
|
shouldCopyGPUBuffers = false;
|
||||||
readbacksEnabled = false;
|
readbacksEnabled = false;
|
||||||
|
|
|
@ -25,10 +25,14 @@ bool getIsFullscreen();
|
||||||
void setIsFullscreen(bool enable);
|
void setIsFullscreen(bool enable);
|
||||||
std::string getFullscreenMode();
|
std::string getFullscreenMode();
|
||||||
void setFullscreenMode(std::string mode);
|
void setFullscreenMode(std::string mode);
|
||||||
u32 getScreenWidth();
|
u32 getWindowWidth();
|
||||||
u32 getScreenHeight();
|
u32 getWindowHeight();
|
||||||
void setScreenWidth(u32 width);
|
void setWindowWidth(u32 width);
|
||||||
void setScreenHeight(u32 height);
|
void setWindowHeight(u32 height);
|
||||||
|
u32 getInternalScreenWidth();
|
||||||
|
u32 getInternalScreenHeight();
|
||||||
|
void setInternalScreenWidth(u32 width);
|
||||||
|
void setInternalScreenHeight(u32 height);
|
||||||
bool debugDump();
|
bool debugDump();
|
||||||
void setDebugDump(bool enable);
|
void setDebugDump(bool enable);
|
||||||
s32 getGpuId();
|
s32 getGpuId();
|
||||||
|
|
|
@ -445,7 +445,8 @@ s32 PS4_SYSV_ABI sceVideoOutConfigureOutputMode_(s32 handle, u32 reserved, const
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegisterLib(Core::Loader::SymbolsResolver* sym) {
|
void RegisterLib(Core::Loader::SymbolsResolver* sym) {
|
||||||
driver = std::make_unique<VideoOutDriver>(Config::getScreenWidth(), Config::getScreenHeight());
|
driver = std::make_unique<VideoOutDriver>(Config::getInternalScreenWidth(),
|
||||||
|
Config::getInternalScreenHeight());
|
||||||
|
|
||||||
LIB_FUNCTION("SbU3dwp80lQ", "libSceVideoOut", 1, "libSceVideoOut", 0, 0,
|
LIB_FUNCTION("SbU3dwp80lQ", "libSceVideoOut", 1, "libSceVideoOut", 0, 0,
|
||||||
sceVideoOutGetFlipStatus);
|
sceVideoOutGetFlipStatus);
|
||||||
|
|
|
@ -222,7 +222,7 @@ void Emulator::Run(std::filesystem::path file, const std::vector<std::string> ar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window = std::make_unique<Frontend::WindowSDL>(
|
window = std::make_unique<Frontend::WindowSDL>(
|
||||||
Config::getScreenWidth(), Config::getScreenHeight(), controller, window_title);
|
Config::getWindowWidth(), Config::getWindowHeight(), controller, window_title);
|
||||||
|
|
||||||
g_window = window.get();
|
g_window = window.get();
|
||||||
|
|
||||||
|
|
|
@ -762,8 +762,8 @@ void SettingsDialog::UpdateSettings() {
|
||||||
m_gui_settings->SetValue(gui::gl_backgroundMusicVolume, ui->BGMVolumeSlider->value());
|
m_gui_settings->SetValue(gui::gl_backgroundMusicVolume, ui->BGMVolumeSlider->value());
|
||||||
Config::setLanguage(languageIndexes[ui->consoleLanguageComboBox->currentIndex()]);
|
Config::setLanguage(languageIndexes[ui->consoleLanguageComboBox->currentIndex()]);
|
||||||
Config::setEnableDiscordRPC(ui->discordRPCCheckbox->isChecked());
|
Config::setEnableDiscordRPC(ui->discordRPCCheckbox->isChecked());
|
||||||
Config::setScreenWidth(ui->widthSpinBox->value());
|
Config::setWindowWidth(ui->widthSpinBox->value());
|
||||||
Config::setScreenHeight(ui->heightSpinBox->value());
|
Config::setWindowHeight(ui->heightSpinBox->value());
|
||||||
Config::setVblankDiv(ui->vblankSpinBox->value());
|
Config::setVblankDiv(ui->vblankSpinBox->value());
|
||||||
Config::setDumpShaders(ui->dumpShadersCheckBox->isChecked());
|
Config::setDumpShaders(ui->dumpShadersCheckBox->isChecked());
|
||||||
Config::setNullGpu(ui->nullGpuCheckBox->isChecked());
|
Config::setNullGpu(ui->nullGpuCheckBox->isChecked());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue