mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-06-04 06:55:03 -06:00
General Misses (0.15.1 WIP part 6) (#4165)
* fixes * fixed a few more config misses * missed include
This commit is contained in:
parent
d0a4718fb9
commit
f450405f35
@ -93,7 +93,8 @@ void EmulatorSettingsImpl::PrintChangedSummary(const std::vector<std::string>& c
|
|||||||
EmulatorSettingsImpl::EmulatorSettingsImpl() = default;
|
EmulatorSettingsImpl::EmulatorSettingsImpl() = default;
|
||||||
|
|
||||||
EmulatorSettingsImpl::~EmulatorSettingsImpl() {
|
EmulatorSettingsImpl::~EmulatorSettingsImpl() {
|
||||||
Save();
|
if (m_loaded)
|
||||||
|
Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<EmulatorSettingsImpl> EmulatorSettingsImpl::GetInstance() {
|
std::shared_ptr<EmulatorSettingsImpl> EmulatorSettingsImpl::GetInstance() {
|
||||||
@ -380,6 +381,7 @@ bool EmulatorSettingsImpl::Load(const std::string& serial) {
|
|||||||
SDL_ShowMessageBox(&msg_box, &result);
|
SDL_ShowMessageBox(&msg_box, &result);
|
||||||
if (result == 1) {
|
if (result == 1) {
|
||||||
if (TransferSettings()) {
|
if (TransferSettings()) {
|
||||||
|
m_loaded = true;
|
||||||
Save();
|
Save();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@ -397,6 +399,7 @@ bool EmulatorSettingsImpl::Load(const std::string& serial) {
|
|||||||
if (GetConfigVersion() != Common::g_scm_rev) {
|
if (GetConfigVersion() != Common::g_scm_rev) {
|
||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
|
m_loaded = true;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// ── Per-game override file ─────────────────────────────────
|
// ── Per-game override file ─────────────────────────────────
|
||||||
|
|||||||
@ -465,6 +465,8 @@ private:
|
|||||||
VulkanSettings m_vulkan{};
|
VulkanSettings m_vulkan{};
|
||||||
ConfigMode m_configMode{ConfigMode::Default};
|
ConfigMode m_configMode{ConfigMode::Default};
|
||||||
|
|
||||||
|
bool m_loaded{false};
|
||||||
|
|
||||||
static std::shared_ptr<EmulatorSettingsImpl> s_instance;
|
static std::shared_ptr<EmulatorSettingsImpl> s_instance;
|
||||||
static std::mutex s_mutex;
|
static std::mutex s_mutex;
|
||||||
|
|
||||||
|
|||||||
@ -318,38 +318,6 @@ s32 PS4_SYSV_ABI sceKernelMapFlexibleMemory(void** addr_in_out, u64 len, s32 pro
|
|||||||
return sceKernelMapNamedFlexibleMemory(addr_in_out, len, prot, flags, "anon");
|
return sceKernelMapNamedFlexibleMemory(addr_in_out, len, prot, flags, "anon");
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceKernelMapNamedSystemFlexibleMemory(void** addr_in_out, u64 len, s32 prot,
|
|
||||||
s32 flags, const char* name) {
|
|
||||||
LOG_INFO(Kernel_Vmm, "in_addr = {}, len = {:#x}, prot = {:#x}, flags = {:#x}, name = '{}'",
|
|
||||||
fmt::ptr(*addr_in_out), len, prot, flags, name);
|
|
||||||
if (len == 0 || !Common::Is16KBAligned(len)) {
|
|
||||||
LOG_ERROR(Kernel_Vmm, "len is 0 or not 16kb multiple");
|
|
||||||
return ORBIS_KERNEL_ERROR_EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name == nullptr) {
|
|
||||||
LOG_ERROR(Kernel_Vmm, "name is invalid!");
|
|
||||||
return ORBIS_KERNEL_ERROR_EFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (std::strlen(name) >= ORBIS_KERNEL_MAXIMUM_NAME_LENGTH) {
|
|
||||||
LOG_ERROR(Kernel_Vmm, "name exceeds 32 bytes!");
|
|
||||||
return ORBIS_KERNEL_ERROR_ENAMETOOLONG;
|
|
||||||
}
|
|
||||||
|
|
||||||
VAddr in_addr = reinterpret_cast<VAddr>(*addr_in_out);
|
|
||||||
if (in_addr == 0) {
|
|
||||||
in_addr = 0x880000000;
|
|
||||||
}
|
|
||||||
const auto mem_prot = static_cast<Core::MemoryProt>(prot);
|
|
||||||
const auto map_flags = static_cast<Core::MemoryMapFlags>(flags);
|
|
||||||
auto* memory = Core::Memory::Instance();
|
|
||||||
const auto ret = memory->MapMemory(addr_in_out, in_addr, len, mem_prot, map_flags,
|
|
||||||
Core::VMAType::Stack, name);
|
|
||||||
LOG_INFO(Kernel_Vmm, "out_addr = {}", fmt::ptr(*addr_in_out));
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceKernelQueryMemoryProtection(void* addr, void** start, void** end, u32* prot) {
|
s32 PS4_SYSV_ABI sceKernelQueryMemoryProtection(void* addr, void** start, void** end, u32* prot) {
|
||||||
auto* memory = Core::Memory::Instance();
|
auto* memory = Core::Memory::Instance();
|
||||||
return memory->QueryProtection(std::bit_cast<VAddr>(addr), start, end, prot);
|
return memory->QueryProtection(std::bit_cast<VAddr>(addr), start, end, prot);
|
||||||
@ -865,7 +833,6 @@ void RegisterMemory(Core::Loader::SymbolsResolver* sym) {
|
|||||||
LIB_FUNCTION("PGhQHd-dzv8", "libkernel", 1, "libkernel", sceKernelMmap);
|
LIB_FUNCTION("PGhQHd-dzv8", "libkernel", 1, "libkernel", sceKernelMmap);
|
||||||
LIB_FUNCTION("cQke9UuBQOk", "libkernel", 1, "libkernel", sceKernelMunmap);
|
LIB_FUNCTION("cQke9UuBQOk", "libkernel", 1, "libkernel", sceKernelMunmap);
|
||||||
LIB_FUNCTION("mL8NDH86iQI", "libkernel", 1, "libkernel", sceKernelMapNamedFlexibleMemory);
|
LIB_FUNCTION("mL8NDH86iQI", "libkernel", 1, "libkernel", sceKernelMapNamedFlexibleMemory);
|
||||||
LIB_FUNCTION("kc+LEEIYakc", "libkernel", 1, "libkernel", sceKernelMapNamedSystemFlexibleMemory);
|
|
||||||
LIB_FUNCTION("aNz11fnnzi4", "libkernel", 1, "libkernel", sceKernelAvailableFlexibleMemorySize);
|
LIB_FUNCTION("aNz11fnnzi4", "libkernel", 1, "libkernel", sceKernelAvailableFlexibleMemorySize);
|
||||||
LIB_FUNCTION("aNz11fnnzi4", "libkernel_avlfmem", 1, "libkernel",
|
LIB_FUNCTION("aNz11fnnzi4", "libkernel_avlfmem", 1, "libkernel",
|
||||||
sceKernelAvailableFlexibleMemorySize);
|
sceKernelAvailableFlexibleMemorySize);
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <variant>
|
#include <variant>
|
||||||
|
|
||||||
|
#include <core/emulator_settings.h>
|
||||||
#include "common/config.h"
|
#include "common/config.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "core/libraries/error_codes.h"
|
#include "core/libraries/error_codes.h"
|
||||||
@ -784,7 +785,7 @@ void DeregisterNpCallback(std::string key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RegisterLib(Core::Loader::SymbolsResolver* sym) {
|
void RegisterLib(Core::Loader::SymbolsResolver* sym) {
|
||||||
g_signed_in = Config::getPSNSignedIn();
|
g_signed_in = EmulatorSettings.IsPSNSignedIn();
|
||||||
|
|
||||||
LIB_FUNCTION("GpLQDNKICac", "libSceNpManager", 1, "libSceNpManager", sceNpCreateRequest);
|
LIB_FUNCTION("GpLQDNKICac", "libSceNpManager", 1, "libSceNpManager", sceNpCreateRequest);
|
||||||
LIB_FUNCTION("eiqMCt9UshI", "libSceNpManager", 1, "libSceNpManager", sceNpCreateAsyncRequest);
|
LIB_FUNCTION("eiqMCt9UshI", "libSceNpManager", 1, "libSceNpManager", sceNpCreateAsyncRequest);
|
||||||
|
|||||||
@ -223,8 +223,7 @@ s32 loadModuleInternal(s32 index, s32 argc, const void* argv, s32* res_out) {
|
|||||||
{"libSceAudiodec.sprx", nullptr},
|
{"libSceAudiodec.sprx", nullptr},
|
||||||
{"libSceFont.sprx", &Libraries::Font::RegisterlibSceFont},
|
{"libSceFont.sprx", &Libraries::Font::RegisterlibSceFont},
|
||||||
{"libSceFontFt.sprx", &Libraries::FontFt::RegisterlibSceFontFt},
|
{"libSceFontFt.sprx", &Libraries::FontFt::RegisterlibSceFontFt},
|
||||||
{"libSceFreeTypeOt.sprx", nullptr},
|
{"libSceFreeTypeOt.sprx", nullptr}});
|
||||||
{"libScePadTracker.sprx", nullptr}});
|
|
||||||
|
|
||||||
// Iterate through the allowed array
|
// Iterate through the allowed array
|
||||||
const auto it = std::ranges::find_if(
|
const auto it = std::ranges::find_if(
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
#include "common/io_file.h"
|
#include "common/io_file.h"
|
||||||
#include "common/path_util.h"
|
#include "common/path_util.h"
|
||||||
#include "core/devtools/layer.h"
|
#include "core/devtools/layer.h"
|
||||||
|
#include "core/emulator_settings.h"
|
||||||
#include "core/emulator_state.h"
|
#include "core/emulator_state.h"
|
||||||
#include "input/controller.h"
|
#include "input/controller.h"
|
||||||
#include "input/input_mouse.h"
|
#include "input/input_mouse.h"
|
||||||
@ -598,13 +599,13 @@ void ControllerOutput::FinalizeUpdate() {
|
|||||||
PushSDLEvent(SDL_EVENT_RDOC_CAPTURE);
|
PushSDLEvent(SDL_EVENT_RDOC_CAPTURE);
|
||||||
break;
|
break;
|
||||||
case HOTKEY_VOLUME_UP:
|
case HOTKEY_VOLUME_UP:
|
||||||
Config::setVolumeSlider(std::clamp(Config::getVolumeSlider() + 10, 0, 500),
|
EmulatorSettings.SetVolumeSlider(
|
||||||
is_game_specific);
|
std::clamp(EmulatorSettings.GetVolumeSlider() + 10, 0, 500));
|
||||||
Overlay::ShowVolume();
|
Overlay::ShowVolume();
|
||||||
break;
|
break;
|
||||||
case HOTKEY_VOLUME_DOWN:
|
case HOTKEY_VOLUME_DOWN:
|
||||||
Config::setVolumeSlider(std::clamp(Config::getVolumeSlider() - 10, 0, 500),
|
EmulatorSettings.SetVolumeSlider(
|
||||||
is_game_specific);
|
std::clamp(EmulatorSettings.GetVolumeSlider() - 10, 0, 500));
|
||||||
Overlay::ShowVolume();
|
Overlay::ShowVolume();
|
||||||
break;
|
break;
|
||||||
case HOTKEY_QUIT:
|
case HOTKEY_QUIT:
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include "SDL3/SDL_metal.h"
|
#include "SDL3/SDL_metal.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include <core/emulator_settings.h>
|
||||||
|
|
||||||
namespace Input {
|
namespace Input {
|
||||||
|
|
||||||
@ -323,9 +324,9 @@ WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_
|
|||||||
}
|
}
|
||||||
if (!error) {
|
if (!error) {
|
||||||
SDL_SetWindowFullscreenMode(
|
SDL_SetWindowFullscreenMode(
|
||||||
window, Config::getFullscreenMode() == "Fullscreen" ? displayMode : NULL);
|
window, EmulatorSettings.GetFullScreenMode() == "Fullscreen" ? displayMode : NULL);
|
||||||
}
|
}
|
||||||
SDL_SetWindowFullscreen(window, Config::getIsFullscreen());
|
SDL_SetWindowFullscreen(window, EmulatorSettings.IsFullScreen());
|
||||||
SDL_SyncWindow(window);
|
SDL_SyncWindow(window);
|
||||||
|
|
||||||
SDL_InitSubSystem(SDL_INIT_GAMEPAD);
|
SDL_InitSubSystem(SDL_INIT_GAMEPAD);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user