summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
-rw-r--r--src/core/CMakeLists.txt6
-rw-r--r--src/core/hle/service/fatal/fatal.cpp38
-rw-r--r--src/core/hle/service/fatal/fatal.h29
-rw-r--r--src/core/hle/service/fatal/fatal_p.cpp14
-rw-r--r--src/core/hle/service/fatal/fatal_p.h18
-rw-r--r--src/core/hle/service/fatal/fatal_u.cpp19
-rw-r--r--src/core/hle/service/fatal/fatal_u.h18
-rw-r--r--src/core/hle/service/service.cpp2
-rw-r--r--src/video_core/engines/maxwell_3d.h49
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 {
37 SUB(Service, AM) \ 37 SUB(Service, AM) \
38 SUB(Service, AOC) \ 38 SUB(Service, AOC) \
39 SUB(Service, APM) \ 39 SUB(Service, APM) \
40 SUB(Service, Fatal) \
40 SUB(Service, Friend) \ 41 SUB(Service, Friend) \
41 SUB(Service, FS) \ 42 SUB(Service, FS) \
42 SUB(Service, HID) \ 43 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 {
54 Service_AOC, ///< The AOC (AddOn Content) service 54 Service_AOC, ///< The AOC (AddOn Content) service
55 Service_APM, ///< The APM (Performance) service 55 Service_APM, ///< The APM (Performance) service
56 Service_Audio, ///< The Audio (Audio control) service 56 Service_Audio, ///< The Audio (Audio control) service
57 Service_Fatal, ///< The Fatal service
57 Service_Friend, ///< The friend service 58 Service_Friend, ///< The friend service
58 Service_FS, ///< The FS (Filesystem) service 59 Service_FS, ///< The FS (Filesystem) service
59 Service_HID, ///< The HID (Human interface device) service 60 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
114 hle/service/audio/audren_u.h 114 hle/service/audio/audren_u.h
115 hle/service/audio/codecctl.cpp 115 hle/service/audio/codecctl.cpp
116 hle/service/audio/codecctl.h 116 hle/service/audio/codecctl.h
117 hle/service/fatal/fatal.cpp
118 hle/service/fatal/fatal.h
119 hle/service/fatal/fatal_p.cpp
120 hle/service/fatal/fatal_p.h
121 hle/service/fatal/fatal_u.cpp
122 hle/service/fatal/fatal_u.h
117 hle/service/filesystem/filesystem.cpp 123 hle/service/filesystem/filesystem.cpp
118 hle/service/filesystem/filesystem.h 124 hle/service/filesystem/filesystem.h
119 hle/service/filesystem/fsp_srv.cpp 125 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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "common/logging/log.h"
6#include "core/hle/ipc_helpers.h"
7#include "core/hle/service/fatal/fatal.h"
8#include "core/hle/service/fatal/fatal_p.h"
9#include "core/hle/service/fatal/fatal_u.h"
10
11namespace Service {
12namespace Fatal {
13
14Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
15 : ServiceFramework(name), module(std::move(module)) {}
16
17void Module::Interface::FatalSimple(Kernel::HLERequestContext& ctx) {
18 IPC::RequestParser rp(ctx);
19 u32 error_code = rp.Pop<u32>();
20 LOG_WARNING(Service_Fatal, "(STUBBED) called, error_code=0x%X", error_code);
21 IPC::ResponseBuilder rb{ctx, 2};
22 rb.Push(RESULT_SUCCESS);
23}
24
25void Module::Interface::TransitionToFatalError(Kernel::HLERequestContext& ctx) {
26 LOG_WARNING(Service_Fatal, "(STUBBED) called");
27 IPC::ResponseBuilder rb{ctx, 2};
28 rb.Push(RESULT_SUCCESS);
29}
30
31void InstallInterfaces(SM::ServiceManager& service_manager) {
32 auto module = std::make_shared<Module>();
33 std::make_shared<Fatal_P>(module)->InstallAsService(service_manager);
34 std::make_shared<Fatal_U>(module)->InstallAsService(service_manager);
35}
36
37} // namespace Fatal
38} // 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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service {
10namespace Fatal {
11
12class Module final {
13public:
14 class Interface : public ServiceFramework<Interface> {
15 public:
16 Interface(std::shared_ptr<Module> module, const char* name);
17
18 void FatalSimple(Kernel::HLERequestContext& ctx);
19 void TransitionToFatalError(Kernel::HLERequestContext& ctx);
20
21 protected:
22 std::shared_ptr<Module> module;
23 };
24};
25
26void InstallInterfaces(SM::ServiceManager& service_manager);
27
28} // namespace Fatal
29} // 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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/fatal/fatal_p.h"
6
7namespace Service {
8namespace Fatal {
9
10Fatal_P::Fatal_P(std::shared_ptr<Module> module)
11 : Module::Interface(std::move(module), "fatal:p") {}
12
13} // namespace Fatal
14} // 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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/fatal/fatal.h"
8
9namespace Service {
10namespace Fatal {
11
12class Fatal_P final : public Module::Interface {
13public:
14 explicit Fatal_P(std::shared_ptr<Module> module);
15};
16
17} // namespace Fatal
18} // 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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/fatal/fatal_u.h"
6
7namespace Service {
8namespace Fatal {
9
10Fatal_U::Fatal_U(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "fatal:u") {
11 static const FunctionInfo functions[] = {
12 {1, &Fatal_U::FatalSimple, "FatalSimple"},
13 {2, &Fatal_U::TransitionToFatalError, "TransitionToFatalError"},
14 };
15 RegisterHandlers(functions);
16}
17
18} // namespace Fatal
19} // 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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/fatal/fatal.h"
8
9namespace Service {
10namespace Fatal {
11
12class Fatal_U final : public Module::Interface {
13public:
14 explicit Fatal_U(std::shared_ptr<Module> module);
15};
16
17} // namespace Fatal
18} // 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 @@
20#include "core/hle/service/aoc/aoc_u.h" 20#include "core/hle/service/aoc/aoc_u.h"
21#include "core/hle/service/apm/apm.h" 21#include "core/hle/service/apm/apm.h"
22#include "core/hle/service/audio/audio.h" 22#include "core/hle/service/audio/audio.h"
23#include "core/hle/service/fatal/fatal.h"
23#include "core/hle/service/filesystem/filesystem.h" 24#include "core/hle/service/filesystem/filesystem.h"
24#include "core/hle/service/friend/friend.h" 25#include "core/hle/service/friend/friend.h"
25#include "core/hle/service/hid/hid.h" 26#include "core/hle/service/hid/hid.h"
@@ -179,6 +180,7 @@ void Init() {
179 AOC::InstallInterfaces(*SM::g_service_manager); 180 AOC::InstallInterfaces(*SM::g_service_manager);
180 APM::InstallInterfaces(*SM::g_service_manager); 181 APM::InstallInterfaces(*SM::g_service_manager);
181 Audio::InstallInterfaces(*SM::g_service_manager); 182 Audio::InstallInterfaces(*SM::g_service_manager);
183 Fatal::InstallInterfaces(*SM::g_service_manager);
182 FileSystem::InstallInterfaces(*SM::g_service_manager); 184 FileSystem::InstallInterfaces(*SM::g_service_manager);
183 Friend::InstallInterfaces(*SM::g_service_manager); 185 Friend::InstallInterfaces(*SM::g_service_manager);
184 HID::InstallInterfaces(*SM::g_service_manager); 186 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:
31 struct Regs { 31 struct Regs {
32 static constexpr size_t NUM_REGS = 0xE36; 32 static constexpr size_t NUM_REGS = 0xE36;
33 33
34 static constexpr size_t NumRenderTargets = 8;
34 static constexpr size_t NumCBData = 16; 35 static constexpr size_t NumCBData = 16;
35 static constexpr size_t NumVertexArrays = 32; 36 static constexpr size_t NumVertexArrays = 32;
36 static constexpr size_t MaxShaderProgram = 6; 37 static constexpr size_t MaxShaderProgram = 6;
@@ -62,7 +63,50 @@ public:
62 63
63 union { 64 union {
64 struct { 65 struct {
65 INSERT_PADDING_WORDS(0x557); 66 INSERT_PADDING_WORDS(0x200);
67
68 struct {
69 u32 address_high;
70 u32 address_low;
71 u32 horiz;
72 u32 vert;
73 u32 format;
74 u32 block_dimensions;
75 u32 array_mode;
76 u32 layer_stride;
77 u32 base_layer;
78 INSERT_PADDING_WORDS(7);
79
80 GPUVAddr Address() const {
81 return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
82 address_low);
83 }
84 } rt[NumRenderTargets];
85
86 INSERT_PADDING_WORDS(0x178);
87
88 struct {
89 u32 address_high;
90 u32 address_low;
91 u32 format;
92 u32 block_dimensions;
93 u32 layer_stride;
94
95 GPUVAddr Address() const {
96 return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
97 address_low);
98 }
99 } zeta;
100
101 INSERT_PADDING_WORDS(0x8A);
102
103 struct {
104 union {
105 BitField<0, 4, u32> count;
106 };
107 } rt_control;
108
109 INSERT_PADDING_WORDS(0xCF);
66 110
67 struct { 111 struct {
68 u32 tsc_address_high; 112 u32 tsc_address_high;
@@ -291,6 +335,9 @@ private:
291 static_assert(offsetof(Maxwell3D::Regs, field_name) == position * 4, \ 335 static_assert(offsetof(Maxwell3D::Regs, field_name) == position * 4, \
292 "Field " #field_name " has invalid position") 336 "Field " #field_name " has invalid position")
293 337
338ASSERT_REG_POSITION(rt, 0x200);
339ASSERT_REG_POSITION(zeta, 0x3F8);
340ASSERT_REG_POSITION(rt_control, 0x487);
294ASSERT_REG_POSITION(tsc, 0x557); 341ASSERT_REG_POSITION(tsc, 0x557);
295ASSERT_REG_POSITION(tic, 0x55D); 342ASSERT_REG_POSITION(tic, 0x55D);
296ASSERT_REG_POSITION(code_address, 0x582); 343ASSERT_REG_POSITION(code_address, 0x582);