mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-03-28 22:49:42 -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() {
|
||||
Save();
|
||||
if (m_loaded)
|
||||
Save();
|
||||
}
|
||||
|
||||
std::shared_ptr<EmulatorSettingsImpl> EmulatorSettingsImpl::GetInstance() {
|
||||
@ -380,6 +381,7 @@ bool EmulatorSettingsImpl::Load(const std::string& serial) {
|
||||
SDL_ShowMessageBox(&msg_box, &result);
|
||||
if (result == 1) {
|
||||
if (TransferSettings()) {
|
||||
m_loaded = true;
|
||||
Save();
|
||||
return true;
|
||||
} else {
|
||||
@ -397,6 +399,7 @@ bool EmulatorSettingsImpl::Load(const std::string& serial) {
|
||||
if (GetConfigVersion() != Common::g_scm_rev) {
|
||||
Save();
|
||||
}
|
||||
m_loaded = true;
|
||||
return true;
|
||||
} else {
|
||||
// ── Per-game override file ─────────────────────────────────
|
||||
|
||||
@ -465,6 +465,8 @@ private:
|
||||
VulkanSettings m_vulkan{};
|
||||
ConfigMode m_configMode{ConfigMode::Default};
|
||||
|
||||
bool m_loaded{false};
|
||||
|
||||
static std::shared_ptr<EmulatorSettingsImpl> s_instance;
|
||||
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");
|
||||
}
|
||||
|
||||
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) {
|
||||
auto* memory = Core::Memory::Instance();
|
||||
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("cQke9UuBQOk", "libkernel", 1, "libkernel", sceKernelMunmap);
|
||||
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_avlfmem", 1, "libkernel",
|
||||
sceKernelAvailableFlexibleMemorySize);
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
#include <mutex>
|
||||
#include <variant>
|
||||
|
||||
#include <core/emulator_settings.h>
|
||||
#include "common/config.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/libraries/error_codes.h"
|
||||
@ -784,7 +785,7 @@ void DeregisterNpCallback(std::string key) {
|
||||
}
|
||||
|
||||
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("eiqMCt9UshI", "libSceNpManager", 1, "libSceNpManager", sceNpCreateAsyncRequest);
|
||||
|
||||
@ -223,8 +223,7 @@ s32 loadModuleInternal(s32 index, s32 argc, const void* argv, s32* res_out) {
|
||||
{"libSceAudiodec.sprx", nullptr},
|
||||
{"libSceFont.sprx", &Libraries::Font::RegisterlibSceFont},
|
||||
{"libSceFontFt.sprx", &Libraries::FontFt::RegisterlibSceFontFt},
|
||||
{"libSceFreeTypeOt.sprx", nullptr},
|
||||
{"libScePadTracker.sprx", nullptr}});
|
||||
{"libSceFreeTypeOt.sprx", nullptr}});
|
||||
|
||||
// Iterate through the allowed array
|
||||
const auto it = std::ranges::find_if(
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
#include "common/io_file.h"
|
||||
#include "common/path_util.h"
|
||||
#include "core/devtools/layer.h"
|
||||
#include "core/emulator_settings.h"
|
||||
#include "core/emulator_state.h"
|
||||
#include "input/controller.h"
|
||||
#include "input/input_mouse.h"
|
||||
@ -598,13 +599,13 @@ void ControllerOutput::FinalizeUpdate() {
|
||||
PushSDLEvent(SDL_EVENT_RDOC_CAPTURE);
|
||||
break;
|
||||
case HOTKEY_VOLUME_UP:
|
||||
Config::setVolumeSlider(std::clamp(Config::getVolumeSlider() + 10, 0, 500),
|
||||
is_game_specific);
|
||||
EmulatorSettings.SetVolumeSlider(
|
||||
std::clamp(EmulatorSettings.GetVolumeSlider() + 10, 0, 500));
|
||||
Overlay::ShowVolume();
|
||||
break;
|
||||
case HOTKEY_VOLUME_DOWN:
|
||||
Config::setVolumeSlider(std::clamp(Config::getVolumeSlider() - 10, 0, 500),
|
||||
is_game_specific);
|
||||
EmulatorSettings.SetVolumeSlider(
|
||||
std::clamp(EmulatorSettings.GetVolumeSlider() - 10, 0, 500));
|
||||
Overlay::ShowVolume();
|
||||
break;
|
||||
case HOTKEY_QUIT:
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#ifdef __APPLE__
|
||||
#include "SDL3/SDL_metal.h"
|
||||
#endif
|
||||
#include <core/emulator_settings.h>
|
||||
|
||||
namespace Input {
|
||||
|
||||
@ -323,9 +324,9 @@ WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_
|
||||
}
|
||||
if (!error) {
|
||||
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_InitSubSystem(SDL_INIT_GAMEPAD);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user