diff options
-rw-r--r-- | src/common/logging/backend.cpp | 1 | ||||
-rw-r--r-- | src/common/logging/log.h | 1 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/core/hle/service/fatal/fatal.cpp | 38 | ||||
-rw-r--r-- | src/core/hle/service/fatal/fatal.h | 29 | ||||
-rw-r--r-- | src/core/hle/service/fatal/fatal_p.cpp | 14 | ||||
-rw-r--r-- | src/core/hle/service/fatal/fatal_p.h | 18 | ||||
-rw-r--r-- | src/core/hle/service/fatal/fatal_u.cpp | 19 | ||||
-rw-r--r-- | src/core/hle/service/fatal/fatal_u.h | 18 | ||||
-rw-r--r-- | src/core/hle/service/service.cpp | 2 | ||||
-rw-r--r-- | src/video_core/engines/maxwell_3d.h | 49 |
11 files changed, 194 insertions, 1 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 7f3ae1a4e..9f3ba19db 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -37,6 +37,7 @@ namespace Log { SUB(Service, AM) \ SUB(Service, AOC) \ SUB(Service, APM) \ + SUB(Service, Fatal) \ SUB(Service, Friend) \ SUB(Service, FS) \ SUB(Service, HID) \ diff --git a/src/common/logging/log.h b/src/common/logging/log.h index 3cf13fcb0..3573e6dc4 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -54,6 +54,7 @@ enum class Class : ClassType { Service_AOC, ///< The AOC (AddOn Content) service Service_APM, ///< The APM (Performance) service Service_Audio, ///< The Audio (Audio control) service + Service_Fatal, ///< The Fatal service Service_Friend, ///< The friend service Service_FS, ///< The FS (Filesystem) service Service_HID, ///< The HID (Human interface device) service diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index faaa50e4d..456b63ac2 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -114,6 +114,12 @@ add_library(core STATIC hle/service/audio/audren_u.h hle/service/audio/codecctl.cpp hle/service/audio/codecctl.h + hle/service/fatal/fatal.cpp + hle/service/fatal/fatal.h + hle/service/fatal/fatal_p.cpp + hle/service/fatal/fatal_p.h + hle/service/fatal/fatal_u.cpp + hle/service/fatal/fatal_u.h hle/service/filesystem/filesystem.cpp hle/service/filesystem/filesystem.h hle/service/filesystem/fsp_srv.cpp diff --git a/src/core/hle/service/fatal/fatal.cpp b/src/core/hle/service/fatal/fatal.cpp new file mode 100644 index 000000000..1a18e0051 --- /dev/null +++ b/src/core/hle/service/fatal/fatal.cpp @@ -0,0 +1,38 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "common/logging/log.h" +#include "core/hle/ipc_helpers.h" +#include "core/hle/service/fatal/fatal.h" +#include "core/hle/service/fatal/fatal_p.h" +#include "core/hle/service/fatal/fatal_u.h" + +namespace Service { +namespace Fatal { + +Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) + : ServiceFramework(name), module(std::move(module)) {} + +void Module::Interface::FatalSimple(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp(ctx); + u32 error_code = rp.Pop<u32>(); + LOG_WARNING(Service_Fatal, "(STUBBED) called, error_code=0x%X", error_code); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); +} + +void Module::Interface::TransitionToFatalError(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_Fatal, "(STUBBED) called"); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); +} + +void InstallInterfaces(SM::ServiceManager& service_manager) { + auto module = std::make_shared<Module>(); + std::make_shared<Fatal_P>(module)->InstallAsService(service_manager); + std::make_shared<Fatal_U>(module)->InstallAsService(service_manager); +} + +} // namespace Fatal +} // namespace Service diff --git a/src/core/hle/service/fatal/fatal.h b/src/core/hle/service/fatal/fatal.h new file mode 100644 index 000000000..85272b4be --- /dev/null +++ b/src/core/hle/service/fatal/fatal.h @@ -0,0 +1,29 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "core/hle/service/service.h" + +namespace Service { +namespace Fatal { + +class Module final { +public: + class Interface : public ServiceFramework<Interface> { + public: + Interface(std::shared_ptr<Module> module, const char* name); + + void FatalSimple(Kernel::HLERequestContext& ctx); + void TransitionToFatalError(Kernel::HLERequestContext& ctx); + + protected: + std::shared_ptr<Module> module; + }; +}; + +void InstallInterfaces(SM::ServiceManager& service_manager); + +} // namespace Fatal +} // namespace Service diff --git a/src/core/hle/service/fatal/fatal_p.cpp b/src/core/hle/service/fatal/fatal_p.cpp new file mode 100644 index 000000000..ba194e340 --- /dev/null +++ b/src/core/hle/service/fatal/fatal_p.cpp @@ -0,0 +1,14 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "core/hle/service/fatal/fatal_p.h" + +namespace Service { +namespace Fatal { + +Fatal_P::Fatal_P(std::shared_ptr<Module> module) + : Module::Interface(std::move(module), "fatal:p") {} + +} // namespace Fatal +} // namespace Service diff --git a/src/core/hle/service/fatal/fatal_p.h b/src/core/hle/service/fatal/fatal_p.h new file mode 100644 index 000000000..d77b24bc4 --- /dev/null +++ b/src/core/hle/service/fatal/fatal_p.h @@ -0,0 +1,18 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "core/hle/service/fatal/fatal.h" + +namespace Service { +namespace Fatal { + +class Fatal_P final : public Module::Interface { +public: + explicit Fatal_P(std::shared_ptr<Module> module); +}; + +} // namespace Fatal +} // namespace Service diff --git a/src/core/hle/service/fatal/fatal_u.cpp b/src/core/hle/service/fatal/fatal_u.cpp new file mode 100644 index 000000000..065cc868d --- /dev/null +++ b/src/core/hle/service/fatal/fatal_u.cpp @@ -0,0 +1,19 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "core/hle/service/fatal/fatal_u.h" + +namespace Service { +namespace Fatal { + +Fatal_U::Fatal_U(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "fatal:u") { + static const FunctionInfo functions[] = { + {1, &Fatal_U::FatalSimple, "FatalSimple"}, + {2, &Fatal_U::TransitionToFatalError, "TransitionToFatalError"}, + }; + RegisterHandlers(functions); +} + +} // namespace Fatal +} // namespace Service diff --git a/src/core/hle/service/fatal/fatal_u.h b/src/core/hle/service/fatal/fatal_u.h new file mode 100644 index 000000000..22374755e --- /dev/null +++ b/src/core/hle/service/fatal/fatal_u.h @@ -0,0 +1,18 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "core/hle/service/fatal/fatal.h" + +namespace Service { +namespace Fatal { + +class Fatal_U final : public Module::Interface { +public: + explicit Fatal_U(std::shared_ptr<Module> module); +}; + +} // namespace Fatal +} // namespace Service diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index d4b08aadf..4846fe092 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -20,6 +20,7 @@ #include "core/hle/service/aoc/aoc_u.h" #include "core/hle/service/apm/apm.h" #include "core/hle/service/audio/audio.h" +#include "core/hle/service/fatal/fatal.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/friend/friend.h" #include "core/hle/service/hid/hid.h" @@ -179,6 +180,7 @@ void Init() { AOC::InstallInterfaces(*SM::g_service_manager); APM::InstallInterfaces(*SM::g_service_manager); Audio::InstallInterfaces(*SM::g_service_manager); + Fatal::InstallInterfaces(*SM::g_service_manager); FileSystem::InstallInterfaces(*SM::g_service_manager); Friend::InstallInterfaces(*SM::g_service_manager); HID::InstallInterfaces(*SM::g_service_manager); diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 096679162..c2db3154a 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h @@ -31,6 +31,7 @@ public: struct Regs { static constexpr size_t NUM_REGS = 0xE36; + static constexpr size_t NumRenderTargets = 8; static constexpr size_t NumCBData = 16; static constexpr size_t NumVertexArrays = 32; static constexpr size_t MaxShaderProgram = 6; @@ -62,7 +63,50 @@ public: union { struct { - INSERT_PADDING_WORDS(0x557); + INSERT_PADDING_WORDS(0x200); + + struct { + u32 address_high; + u32 address_low; + u32 horiz; + u32 vert; + u32 format; + u32 block_dimensions; + u32 array_mode; + u32 layer_stride; + u32 base_layer; + INSERT_PADDING_WORDS(7); + + GPUVAddr Address() const { + return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) | + address_low); + } + } rt[NumRenderTargets]; + + INSERT_PADDING_WORDS(0x178); + + struct { + u32 address_high; + u32 address_low; + u32 format; + u32 block_dimensions; + u32 layer_stride; + + GPUVAddr Address() const { + return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) | + address_low); + } + } zeta; + + INSERT_PADDING_WORDS(0x8A); + + struct { + union { + BitField<0, 4, u32> count; + }; + } rt_control; + + INSERT_PADDING_WORDS(0xCF); struct { u32 tsc_address_high; @@ -291,6 +335,9 @@ private: static_assert(offsetof(Maxwell3D::Regs, field_name) == position * 4, \ "Field " #field_name " has invalid position") +ASSERT_REG_POSITION(rt, 0x200); +ASSERT_REG_POSITION(zeta, 0x3F8); +ASSERT_REG_POSITION(rt_control, 0x487); ASSERT_REG_POSITION(tsc, 0x557); ASSERT_REG_POSITION(tic, 0x55D); ASSERT_REG_POSITION(code_address, 0x582); |