diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/gdbstub/gdbstub.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/applets/erreula.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/applets/mii_selector.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/applets/swkbd.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/kernel/event.cpp | 5 | ||||
-rw-r--r-- | src/core/hle/kernel/timer.cpp | 5 | ||||
-rw-r--r-- | src/core/hle/service/apt/apt.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/service/apt/apt.h | 23 | ||||
-rw-r--r-- | src/core/hle/service/err_f.cpp | 316 | ||||
-rw-r--r-- | src/core/settings.cpp | 7 | ||||
-rw-r--r-- | src/core/settings.h | 11 |
11 files changed, 254 insertions, 135 deletions
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index ceb993ea1..aea43e92b 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -14,7 +14,7 @@ #include <numeric> #include <fcntl.h> -#ifdef _MSC_VER +#ifdef _WIN32 #include <WinSock2.h> #include <common/x64/abi.h> #include <io.h> diff --git a/src/core/hle/applets/erreula.cpp b/src/core/hle/applets/erreula.cpp index 14964427b..e1379ac4d 100644 --- a/src/core/hle/applets/erreula.cpp +++ b/src/core/hle/applets/erreula.cpp @@ -10,7 +10,7 @@ namespace HLE { namespace Applets { ResultCode ErrEula::ReceiveParameter(const Service::APT::MessageParameter& parameter) { - if (parameter.signal != static_cast<u32>(Service::APT::SignalType::LibAppJustStarted)) { + if (parameter.signal != static_cast<u32>(Service::APT::SignalType::Request)) { LOG_ERROR(Service_APT, "unsupported signal %u", parameter.signal); UNIMPLEMENTED(); // TODO(Subv): Find the right error code @@ -36,7 +36,7 @@ ResultCode ErrEula::ReceiveParameter(const Service::APT::MessageParameter& param // Send the response message with the newly created SharedMemory Service::APT::MessageParameter result; - result.signal = static_cast<u32>(Service::APT::SignalType::LibAppFinished); + result.signal = static_cast<u32>(Service::APT::SignalType::Response); result.buffer.clear(); result.destination_id = static_cast<u32>(Service::APT::AppletId::Application); result.sender_id = static_cast<u32>(id); @@ -57,7 +57,7 @@ ResultCode ErrEula::StartImpl(const Service::APT::AppletStartupParameter& parame Service::APT::MessageParameter message; message.buffer.resize(parameter.buffer.size()); std::fill(message.buffer.begin(), message.buffer.end(), 0); - message.signal = static_cast<u32>(Service::APT::SignalType::LibAppClosed); + message.signal = static_cast<u32>(Service::APT::SignalType::WakeupByExit); message.destination_id = static_cast<u32>(Service::APT::AppletId::Application); message.sender_id = static_cast<u32>(id); Service::APT::SendParameter(message); diff --git a/src/core/hle/applets/mii_selector.cpp b/src/core/hle/applets/mii_selector.cpp index 53a8683a4..3455b9201 100644 --- a/src/core/hle/applets/mii_selector.cpp +++ b/src/core/hle/applets/mii_selector.cpp @@ -19,7 +19,7 @@ namespace HLE { namespace Applets { ResultCode MiiSelector::ReceiveParameter(const Service::APT::MessageParameter& parameter) { - if (parameter.signal != static_cast<u32>(Service::APT::SignalType::LibAppJustStarted)) { + if (parameter.signal != static_cast<u32>(Service::APT::SignalType::Request)) { LOG_ERROR(Service_APT, "unsupported signal %u", parameter.signal); UNIMPLEMENTED(); // TODO(Subv): Find the right error code @@ -44,7 +44,7 @@ ResultCode MiiSelector::ReceiveParameter(const Service::APT::MessageParameter& p // Send the response message with the newly created SharedMemory Service::APT::MessageParameter result; - result.signal = static_cast<u32>(Service::APT::SignalType::LibAppFinished); + result.signal = static_cast<u32>(Service::APT::SignalType::Response); result.buffer.clear(); result.destination_id = static_cast<u32>(Service::APT::AppletId::Application); result.sender_id = static_cast<u32>(id); @@ -73,7 +73,7 @@ ResultCode MiiSelector::StartImpl(const Service::APT::AppletStartupParameter& pa Service::APT::MessageParameter message; message.buffer.resize(sizeof(MiiResult)); std::memcpy(message.buffer.data(), &result, message.buffer.size()); - message.signal = static_cast<u32>(Service::APT::SignalType::LibAppClosed); + message.signal = static_cast<u32>(Service::APT::SignalType::WakeupByExit); message.destination_id = static_cast<u32>(Service::APT::AppletId::Application); message.sender_id = static_cast<u32>(id); Service::APT::SendParameter(message); diff --git a/src/core/hle/applets/swkbd.cpp b/src/core/hle/applets/swkbd.cpp index 06ddf538b..1e21337f5 100644 --- a/src/core/hle/applets/swkbd.cpp +++ b/src/core/hle/applets/swkbd.cpp @@ -22,7 +22,7 @@ namespace HLE { namespace Applets { ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter const& parameter) { - if (parameter.signal != static_cast<u32>(Service::APT::SignalType::LibAppJustStarted)) { + if (parameter.signal != static_cast<u32>(Service::APT::SignalType::Request)) { LOG_ERROR(Service_APT, "unsupported signal %u", parameter.signal); UNIMPLEMENTED(); // TODO(Subv): Find the right error code @@ -47,7 +47,7 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con // Send the response message with the newly created SharedMemory Service::APT::MessageParameter result; - result.signal = static_cast<u32>(Service::APT::SignalType::LibAppFinished); + result.signal = static_cast<u32>(Service::APT::SignalType::Response); result.buffer.clear(); result.destination_id = static_cast<u32>(Service::APT::AppletId::Application); result.sender_id = static_cast<u32>(id); @@ -108,7 +108,7 @@ void SoftwareKeyboard::Finalize() { Service::APT::MessageParameter message; message.buffer.resize(sizeof(SoftwareKeyboardConfig)); std::memcpy(message.buffer.data(), &config, message.buffer.size()); - message.signal = static_cast<u32>(Service::APT::SignalType::LibAppClosed); + message.signal = static_cast<u32>(Service::APT::SignalType::WakeupByExit); message.destination_id = static_cast<u32>(Service::APT::AppletId::Application); message.sender_id = static_cast<u32>(id); Service::APT::SendParameter(message); diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index 1489c7002..3e116e3df 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp @@ -22,6 +22,11 @@ SharedPtr<Event> Event::Create(ResetType reset_type, std::string name) { evt->reset_type = reset_type; evt->name = std::move(name); + if (reset_type == ResetType::Pulse) { + LOG_ERROR(Kernel, "Unimplemented event reset type Pulse"); + UNIMPLEMENTED(); + } + return evt; } diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index a9f98223c..eac181f4e 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp @@ -31,6 +31,11 @@ SharedPtr<Timer> Timer::Create(ResetType reset_type, std::string name) { timer->interval_delay = 0; timer->callback_handle = timer_callback_handle_table.Create(timer).MoveFrom(); + if (reset_type == ResetType::Pulse) { + LOG_ERROR(Kernel, "Unimplemented timer reset type Pulse"); + UNIMPLEMENTED(); + } + return timer; } diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index c4bd65986..c7198293e 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -523,7 +523,7 @@ void Init() { notification_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "APT_U:Notification"); parameter_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "APT_U:Start"); - next_parameter.signal = static_cast<u32>(SignalType::AppJustStarted); + next_parameter.signal = static_cast<u32>(SignalType::Wakeup); next_parameter.destination_id = 0x300; } diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h index a118cda1f..cbcba96a5 100644 --- a/src/core/hle/service/apt/apt.h +++ b/src/core/hle/service/apt/apt.h @@ -46,12 +46,23 @@ static_assert(sizeof(CaptureBufferInfo) == 0x20, "CaptureBufferInfo struct has i /// Signals used by APT functions enum class SignalType : u32 { None = 0x0, - AppJustStarted = 0x1, - LibAppJustStarted = 0x2, - LibAppFinished = 0x3, - LibAppClosed = 0xA, - ReturningToApp = 0xB, - ExitingApp = 0xC, + Wakeup = 0x1, + Request = 0x2, + Response = 0x3, + Exit = 0x4, + Message = 0x5, + HomeButtonSingle = 0x6, + HomeButtonDouble = 0x7, + DspSleep = 0x8, + DspWakeup = 0x9, + WakeupByExit = 0xA, + WakeupByPause = 0xB, + WakeupByCancel = 0xC, + WakeupByCancelAll = 0xD, + WakeupByPowerButtonClick = 0xE, + WakeupToJumpHome = 0xF, + RequestForSysApplet = 0x10, + WakeupToLaunchApplication = 0x11, }; /// App Id's used by APT functions diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp index 3ca4f98de..9905757c7 100644 --- a/src/core/hle/service/err_f.cpp +++ b/src/core/hle/service/err_f.cpp @@ -2,9 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <array> +#include <chrono> +#include <iomanip> +#include <sstream> + #include "common/bit_field.h" #include "common/common_types.h" #include "common/logging/log.h" +#include "core/hle/result.h" #include "core/hle/service/err_f.h" //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -12,12 +18,45 @@ namespace ERR_F { -enum { - ErrSpecifier0 = 0, - ErrSpecifier1 = 1, - ErrSpecifier3 = 3, - ErrSpecifier4 = 4, +enum class FatalErrType : u32 { + Generic = 0, + Corrupted = 1, + CardRemoved = 2, + Exception = 3, + ResultFailure = 4, + Logged = 5, +}; + +enum class ExceptionType : u32 { + PrefetchAbort = 0, + DataAbort = 1, + Undefined = 2, + VectorFP = 3, +}; + +struct ExceptionInfo { + u8 exception_type; + INSERT_PADDING_BYTES(3); + u32 sr; + u32 ar; + u32 fpexc; + u32 fpinst; + u32 fpinst2; +}; +static_assert(sizeof(ExceptionInfo) == 0x18, "ExceptionInfo struct has incorrect size"); + +struct ExceptionContext final { + std::array<u32, 16> arm_regs; + u32 cpsr; }; +static_assert(sizeof(ExceptionContext) == 0x44, "ExceptionContext struct has incorrect size"); + +struct ExceptionData { + ExceptionInfo exception_info; + ExceptionContext exception_context; + INSERT_PADDING_WORDS(1); +}; +static_assert(sizeof(ExceptionData) == 0x60, "ExceptionData struct has incorrect size"); // This is used instead of ResultCode from result.h // because we can't have non-trivial data members in unions. @@ -30,150 +69,191 @@ union RSL { BitField<27, 5, u32> level; }; -union ErrInfo { - u8 specifier; - - struct { - u8 specifier; // 0x0 - u8 rev_high; // 0x1 - u16 rev_low; // 0x2 - RSL result_code; // 0x4 - u32 address; // 0x8 - INSERT_PADDING_BYTES(4); // 0xC - u32 pid_low; // 0x10 - u32 pid_high; // 0x14 - u32 aid_low; // 0x18 - u32 aid_high; // 0x1C - } errtype1; - - struct { - u8 specifier; // 0x0 - u8 rev_high; // 0x1 - u16 rev_low; // 0x2 - INSERT_PADDING_BYTES(0xC); // 0x4 - u32 pid_low; // 0x10 - u32 pid_high; // 0x14 - u32 aid_low; // 0x18 - u32 aid_high; // 0x1C - u8 error_type; // 0x20 - INSERT_PADDING_BYTES(3); // 0x21 - u32 fault_status_reg; // 0x24 - u32 fault_addr; // 0x28 - u32 fpexc; // 0x2C - u32 finst; // 0x30 - u32 finst2; // 0x34 - INSERT_PADDING_BYTES(0x34); // 0x38 - u32 sp; // 0x6C - u32 pc; // 0x70 - u32 lr; // 0x74 - u32 cpsr; // 0x78 - } errtype3; - - struct { - u8 specifier; // 0x0 - u8 rev_high; // 0x1 - u16 rev_low; // 0x2 - RSL result_code; // 0x4 - INSERT_PADDING_BYTES(8); // 0x8 - u32 pid_low; // 0x10 - u32 pid_high; // 0x14 - u32 aid_low; // 0x18 - u32 aid_high; // 0x1C - char debug_string1[0x2E]; // 0x20 - char debug_string2[0x2E]; // 0x4E - } errtype4; +struct ErrInfo { + struct ErrInfoCommon { + u8 specifier; // 0x0 + u8 rev_high; // 0x1 + u16 rev_low; // 0x2 + RSL result_code; // 0x4 + u32 pc_address; // 0x8 + u32 pid; // 0xC + u32 title_id_low; // 0x10 + u32 title_id_high; // 0x14 + u32 app_title_id_low; // 0x18 + u32 app_title_id_high; // 0x1C + } errinfo_common; + static_assert(sizeof(ErrInfoCommon) == 0x20, "ErrInfoCommon struct has incorrect size"); + + union { + struct { + char data[0x60]; // 0x20 + } generic; + + struct { + ExceptionData exception_data; // 0x20 + } exception; + + struct { + char message[0x60]; // 0x20 + } result_failure; + }; }; -enum { PrefetchAbort = 0, DataAbort = 1, UndefInstr = 2, VectorFP = 3 }; +static std::string GetErrType(u8 type_code) { + switch (static_cast<FatalErrType>(type_code)) { + case FatalErrType::Generic: + return "Generic"; + case FatalErrType::Corrupted: + return "Corrupted"; + case FatalErrType::CardRemoved: + return "CardRemoved"; + case FatalErrType::Exception: + return "Exception"; + case FatalErrType::ResultFailure: + return "ResultFailure"; + case FatalErrType::Logged: + return "Logged"; + default: + return "Unknown Error Type"; + } +} -static std::string GetErrInfo3Type(u8 type_code) { - switch (type_code) { - case PrefetchAbort: +static std::string GetExceptionType(u8 type_code) { + switch (static_cast<ExceptionType>(type_code)) { + case ExceptionType::PrefetchAbort: return "Prefetch Abort"; - case DataAbort: + case ExceptionType::DataAbort: return "Data Abort"; - case UndefInstr: - return "Undefined Instruction"; - case VectorFP: - return "Vector Floating Point"; + case ExceptionType::Undefined: + return "Undefined Exception"; + case ExceptionType::VectorFP: + return "Vector Floating Point Exception"; default: - return "unknown"; + return "Unknown Exception Type"; } } +static std::string GetCurrentSystemTime() { + auto now = std::chrono::system_clock::now(); + auto time = std::chrono::system_clock::to_time_t(now); + + std::stringstream time_stream; + time_stream << std::put_time(std::localtime(&time), "%Y/%m/%d %H:%M:%S"); + return time_stream.str(); +} + +static void LogGenericInfo(const ErrInfo::ErrInfoCommon& errinfo_common) { + LOG_CRITICAL(Service_ERR, "PID: 0x%08X", errinfo_common.pid); + LOG_CRITICAL(Service_ERR, "REV: 0x%08X_0x%08X", errinfo_common.rev_high, + errinfo_common.rev_low); + LOG_CRITICAL(Service_ERR, "TID: 0x%08X_0x%08X", errinfo_common.title_id_high, + errinfo_common.title_id_low); + LOG_CRITICAL(Service_ERR, "AID: 0x%08X_0x%08X", errinfo_common.app_title_id_high, + errinfo_common.app_title_id_low); + LOG_CRITICAL(Service_ERR, "ADR: 0x%08X", errinfo_common.pc_address); + + LOG_CRITICAL(Service_ERR, "RSL: 0x%08X", errinfo_common.result_code.raw); + LOG_CRITICAL(Service_ERR, " Level: %u", errinfo_common.result_code.level.Value()); + LOG_CRITICAL(Service_ERR, " Summary: %u", errinfo_common.result_code.summary.Value()); + LOG_CRITICAL(Service_ERR, " Module: %u", errinfo_common.result_code.module.Value()); + LOG_CRITICAL(Service_ERR, " Desc: %u", errinfo_common.result_code.description.Value()); +} + +/* ThrowFatalError function + * Inputs: + * 0 : Header code [0x00010800] + * 1-32 : FatalErrInfo + * Outputs: + * 0 : Header code + * 1 : Result code + */ static void ThrowFatalError(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - LOG_CRITICAL(Service_ERR, "Fatal error!"); + LOG_CRITICAL(Service_ERR, "Fatal error"); const ErrInfo* errinfo = reinterpret_cast<ErrInfo*>(&cmd_buff[1]); + LOG_CRITICAL(Service_ERR, "Fatal error type: %s", + GetErrType(errinfo->errinfo_common.specifier).c_str()); - switch (errinfo->specifier) { - case ErrSpecifier0: - case ErrSpecifier1: { - const auto& errtype = errinfo->errtype1; - LOG_CRITICAL(Service_ERR, "PID: 0x%08X_0x%08X", errtype.pid_low, errtype.pid_high); - LOG_CRITICAL(Service_ERR, "REV: %d", errtype.rev_low | (errtype.rev_high << 16)); - LOG_CRITICAL(Service_ERR, "AID: 0x%08X_0x%08X", errtype.aid_low, errtype.aid_high); - LOG_CRITICAL(Service_ERR, "ADR: 0x%08X", errtype.address); - - LOG_CRITICAL(Service_ERR, "RSL: 0x%08X", errtype.result_code.raw); - LOG_CRITICAL(Service_ERR, " Level: %u", errtype.result_code.level.Value()); - LOG_CRITICAL(Service_ERR, " Summary: %u", errtype.result_code.summary.Value()); - LOG_CRITICAL(Service_ERR, " Module: %u", errtype.result_code.module.Value()); - LOG_CRITICAL(Service_ERR, " Desc: %u", errtype.result_code.description.Value()); + // Generic Info + LogGenericInfo(errinfo->errinfo_common); + + switch (static_cast<FatalErrType>(errinfo->errinfo_common.specifier)) { + case FatalErrType::Generic: + case FatalErrType::Corrupted: + case FatalErrType::CardRemoved: + case FatalErrType::Logged: { + LOG_CRITICAL(Service_ERR, "Datetime: %s", GetCurrentSystemTime().c_str()); break; } + case FatalErrType::Exception: { + const auto& errtype = errinfo->exception; + + // Register Info + LOG_CRITICAL(Service_ERR, "ARM Registers:"); + for (u32 index = 0; index < errtype.exception_data.exception_context.arm_regs.size(); + ++index) { + if (index < 13) { + LOG_DEBUG(Service_ERR, "r%u=0x%08X", index, + errtype.exception_data.exception_context.arm_regs.at(index)); + } else if (index == 13) { + LOG_CRITICAL(Service_ERR, "SP=0x%08X", + errtype.exception_data.exception_context.arm_regs.at(index)); + } else if (index == 14) { + LOG_CRITICAL(Service_ERR, "LR=0x%08X", + errtype.exception_data.exception_context.arm_regs.at(index)); + } else if (index == 15) { + LOG_CRITICAL(Service_ERR, "PC=0x%08X", + errtype.exception_data.exception_context.arm_regs.at(index)); + } + } + LOG_CRITICAL(Service_ERR, "CPSR=0x%08X", errtype.exception_data.exception_context.cpsr); - case ErrSpecifier3: { - const auto& errtype = errinfo->errtype3; - LOG_CRITICAL(Service_ERR, "PID: 0x%08X_0x%08X", errtype.pid_low, errtype.pid_high); - LOG_CRITICAL(Service_ERR, "REV: %d", errtype.rev_low | (errtype.rev_high << 16)); - LOG_CRITICAL(Service_ERR, "AID: 0x%08X_0x%08X", errtype.aid_low, errtype.aid_high); - LOG_CRITICAL(Service_ERR, "TYPE: %s", GetErrInfo3Type(errtype.error_type).c_str()); - - LOG_CRITICAL(Service_ERR, "PC: 0x%08X", errtype.pc); - LOG_CRITICAL(Service_ERR, "LR: 0x%08X", errtype.lr); - LOG_CRITICAL(Service_ERR, "SP: 0x%08X", errtype.sp); - LOG_CRITICAL(Service_ERR, "CPSR: 0x%08X", errtype.cpsr); - - switch (errtype.error_type) { - case PrefetchAbort: - case DataAbort: - LOG_CRITICAL(Service_ERR, "Fault Address: 0x%08X", errtype.fault_addr); - LOG_CRITICAL(Service_ERR, "Fault Status Register: 0x%08X", errtype.fault_status_reg); + // Exception Info + LOG_CRITICAL( + Service_ERR, "EXCEPTION TYPE: %s", + GetExceptionType(errtype.exception_data.exception_info.exception_type).c_str()); + switch (static_cast<ExceptionType>(errtype.exception_data.exception_info.exception_type)) { + case ExceptionType::PrefetchAbort: + LOG_CRITICAL(Service_ERR, "IFSR: 0x%08X", errtype.exception_data.exception_info.sr); + LOG_CRITICAL(Service_ERR, "r15: 0x%08X", errtype.exception_data.exception_info.ar); + case ExceptionType::DataAbort: + LOG_CRITICAL(Service_ERR, "DFSR: 0x%08X", errtype.exception_data.exception_info.sr); + LOG_CRITICAL(Service_ERR, "DFAR: 0x%08X", errtype.exception_data.exception_info.ar); break; - case VectorFP: - LOG_CRITICAL(Service_ERR, "FPEXC: 0x%08X", errtype.fpexc); - LOG_CRITICAL(Service_ERR, "FINST: 0x%08X", errtype.finst); - LOG_CRITICAL(Service_ERR, "FINST2: 0x%08X", errtype.finst2); + case ExceptionType::VectorFP: + LOG_CRITICAL(Service_ERR, "FPEXC: 0x%08X", + errtype.exception_data.exception_info.fpinst); + LOG_CRITICAL(Service_ERR, "FINST: 0x%08X", + errtype.exception_data.exception_info.fpinst); + LOG_CRITICAL(Service_ERR, "FINST2: 0x%08X", + errtype.exception_data.exception_info.fpinst2); break; } + LOG_CRITICAL(Service_ERR, "Datetime: %s", GetCurrentSystemTime().c_str()); break; } - case ErrSpecifier4: { - const auto& errtype = errinfo->errtype4; - LOG_CRITICAL(Service_ERR, "PID: 0x%08X_0x%08X", errtype.pid_low, errtype.pid_high); - LOG_CRITICAL(Service_ERR, "REV: %d", errtype.rev_low | (errtype.rev_high << 16)); - LOG_CRITICAL(Service_ERR, "AID: 0x%08X_0x%08X", errtype.aid_low, errtype.aid_high); + case FatalErrType::ResultFailure: { + const auto& errtype = errinfo->result_failure; - LOG_CRITICAL(Service_ERR, "RSL: 0x%08X", errtype.result_code.raw); - LOG_CRITICAL(Service_ERR, " Level: %u", errtype.result_code.level.Value()); - LOG_CRITICAL(Service_ERR, " Summary: %u", errtype.result_code.summary.Value()); - LOG_CRITICAL(Service_ERR, " Module: %u", errtype.result_code.module.Value()); - LOG_CRITICAL(Service_ERR, " Desc: %u", errtype.result_code.description.Value()); - - LOG_CRITICAL(Service_ERR, "%s", errtype.debug_string1); - LOG_CRITICAL(Service_ERR, "%s", errtype.debug_string2); + // Failure Message + LOG_CRITICAL(Service_ERR, "Failure Message: %s", errtype.message); + LOG_CRITICAL(Service_ERR, "Datetime: %s", GetCurrentSystemTime().c_str()); break; } - } - cmd_buff[1] = 0; // No error + } // switch FatalErrType + + cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0); + cmd_buff[1] = RESULT_SUCCESS.raw; // No error } const Interface::FunctionInfo FunctionTable[] = { + // clang-format off {0x00010800, ThrowFatalError, "ThrowFatalError"}, + {0x00020042, nullptr, "SetUserString"}, + // clang-format on }; //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 4a0969b00..05f41f798 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -7,6 +7,8 @@ #include "settings.h" #include "video_core/video_core.h" +#include "common/emu_window.h" + namespace Settings { Values values = {}; @@ -20,6 +22,11 @@ void Apply() { VideoCore::g_shader_jit_enabled = values.use_shader_jit; VideoCore::g_scaled_resolution_enabled = values.use_scaled_resolution; + if (VideoCore::g_emu_window) { + auto layout = VideoCore::g_emu_window->GetFramebufferLayout(); + VideoCore::g_emu_window->UpdateCurrentFramebufferLayout(layout.width, layout.height); + } + AudioCore::SelectSink(values.sink_id); AudioCore::EnableStretching(values.enable_audio_stretching); } diff --git a/src/core/settings.h b/src/core/settings.h index 5a64f8018..e931953d7 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -10,7 +10,15 @@ namespace Settings { +enum class LayoutOption { + Default, + SingleScreen, + LargeScreen, + Custom, +}; + namespace NativeInput { + enum Values { // directly mapped keys A, @@ -84,6 +92,9 @@ struct Values { bool use_scaled_resolution; bool use_vsync; + LayoutOption layout_option; + bool swap_screen; + float bg_red; float bg_green; float bg_blue; |