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.txt12
-rw-r--r--src/core/hle/service/grc/grc.cpp31
-rw-r--r--src/core/hle/service/grc/grc.h15
-rw-r--r--src/core/hle/service/hid/hid.cpp225
-rw-r--r--src/core/hle/service/hid/irs.cpp49
-rw-r--r--src/core/hle/service/hid/irs.h21
-rw-r--r--src/core/hle/service/hid/xcd.cpp37
-rw-r--r--src/core/hle/service/hid/xcd.h16
-rw-r--r--src/core/hle/service/ldn/ldn.cpp142
-rw-r--r--src/core/hle/service/ldn/ldn.h16
-rw-r--r--src/core/hle/service/lm/lm.cpp60
-rw-r--r--src/core/hle/service/lm/lm.h15
-rw-r--r--src/core/hle/service/nim/nim.cpp124
-rw-r--r--src/core/hle/service/nim/nim.h15
-rw-r--r--src/core/hle/service/service.cpp6
-rw-r--r--src/core/hle/service/sockets/bsd.cpp22
-rw-r--r--src/core/hle/service/sockets/bsd.h5
-rw-r--r--src/core/hle/service/sockets/ethc.cpp38
-rw-r--r--src/core/hle/service/sockets/ethc.h21
-rw-r--r--src/core/hle/service/sockets/sockets.cpp7
-rw-r--r--src/video_core/gpu.h6
-rw-r--r--src/video_core/memory_manager.cpp36
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp38
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h75
-rw-r--r--src/video_core/textures/decoders.cpp3
-rw-r--r--src/yuzu/main.cpp2
-rw-r--r--src/yuzu_cmd/default_ini.h2
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2.cpp2
30 files changed, 969 insertions, 74 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 59b999935..ad9edbcdf 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -173,6 +173,7 @@ void FileBackend::Write(const Entry& entry) {
173 SUB(Service, Friend) \ 173 SUB(Service, Friend) \
174 SUB(Service, FS) \ 174 SUB(Service, FS) \
175 SUB(Service, HID) \ 175 SUB(Service, HID) \
176 SUB(Service, LDN) \
176 SUB(Service, LM) \ 177 SUB(Service, LM) \
177 SUB(Service, MM) \ 178 SUB(Service, MM) \
178 SUB(Service, NFP) \ 179 SUB(Service, NFP) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index e7115933f..ad3cbf5d1 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -60,6 +60,7 @@ enum class Class : ClassType {
60 Service_Friend, ///< The friend service 60 Service_Friend, ///< The friend service
61 Service_FS, ///< The FS (Filesystem) service 61 Service_FS, ///< The FS (Filesystem) service
62 Service_HID, ///< The HID (Human interface device) service 62 Service_HID, ///< The HID (Human interface device) service
63 Service_LDN, ///< The LDN (Local domain network) service
63 Service_LM, ///< The LM (Logger) service 64 Service_LM, ///< The LM (Logger) service
64 Service_MM, ///< The MM (Multimedia) service 65 Service_MM, ///< The MM (Multimedia) service
65 Service_NFP, ///< The NFP service 66 Service_NFP, ///< The NFP service
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 2e2de59b1..b74e495ef 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -156,8 +156,16 @@ add_library(core STATIC
156 hle/service/friend/friend.h 156 hle/service/friend/friend.h
157 hle/service/friend/interface.cpp 157 hle/service/friend/interface.cpp
158 hle/service/friend/interface.h 158 hle/service/friend/interface.h
159 hle/service/grc/grc.cpp
160 hle/service/grc/grc.h
159 hle/service/hid/hid.cpp 161 hle/service/hid/hid.cpp
160 hle/service/hid/hid.h 162 hle/service/hid/hid.h
163 hle/service/hid/irs.cpp
164 hle/service/hid/irs.h
165 hle/service/hid/xcd.cpp
166 hle/service/hid/xcd.h
167 hle/service/ldn/ldn.cpp
168 hle/service/ldn/ldn.h
161 hle/service/ldr/ldr.cpp 169 hle/service/ldr/ldr.cpp
162 hle/service/ldr/ldr.h 170 hle/service/ldr/ldr.h
163 hle/service/lm/lm.cpp 171 hle/service/lm/lm.cpp
@@ -170,6 +178,8 @@ add_library(core STATIC
170 hle/service/nfp/nfp_user.h 178 hle/service/nfp/nfp_user.h
171 hle/service/nifm/nifm.cpp 179 hle/service/nifm/nifm.cpp
172 hle/service/nifm/nifm.h 180 hle/service/nifm/nifm.h
181 hle/service/nim/nim.cpp
182 hle/service/nim/nim.h
173 hle/service/ns/ns.cpp 183 hle/service/ns/ns.cpp
174 hle/service/ns/ns.h 184 hle/service/ns/ns.h
175 hle/service/ns/pl_u.cpp 185 hle/service/ns/pl_u.cpp
@@ -225,6 +235,8 @@ add_library(core STATIC
225 hle/service/sm/sm.h 235 hle/service/sm/sm.h
226 hle/service/sockets/bsd.cpp 236 hle/service/sockets/bsd.cpp
227 hle/service/sockets/bsd.h 237 hle/service/sockets/bsd.h
238 hle/service/sockets/ethc.cpp
239 hle/service/sockets/ethc.h
228 hle/service/sockets/nsd.cpp 240 hle/service/sockets/nsd.cpp
229 hle/service/sockets/nsd.h 241 hle/service/sockets/nsd.h
230 hle/service/sockets/sfdnsres.cpp 242 hle/service/sockets/sfdnsres.cpp
diff --git a/src/core/hle/service/grc/grc.cpp b/src/core/hle/service/grc/grc.cpp
new file mode 100644
index 000000000..24910ac6c
--- /dev/null
+++ b/src/core/hle/service/grc/grc.cpp
@@ -0,0 +1,31 @@
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 <memory>
6
7#include "core/hle/service/grc/grc.h"
8#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h"
10
11namespace Service::GRC {
12
13class GRC final : public ServiceFramework<GRC> {
14public:
15 explicit GRC() : ServiceFramework{"grc:c"} {
16 // clang-format off
17 static const FunctionInfo functions[] = {
18 {1, nullptr, "OpenContinuousRecorder"},
19 {2, nullptr, "OpenGameMovieTrimmer"},
20 };
21 // clang-format on
22
23 RegisterHandlers(functions);
24 }
25};
26
27void InstallInterfaces(SM::ServiceManager& sm) {
28 std::make_shared<GRC>()->InstallAsService(sm);
29}
30
31} // namespace Service::GRC
diff --git a/src/core/hle/service/grc/grc.h b/src/core/hle/service/grc/grc.h
new file mode 100644
index 000000000..e0d29e70d
--- /dev/null
+++ b/src/core/hle/service/grc/grc.h
@@ -0,0 +1,15 @@
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
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::GRC {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // namespace Service::GRC
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 9a02ba686..e4619a547 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -14,6 +14,8 @@
14#include "core/hle/kernel/event.h" 14#include "core/hle/kernel/event.h"
15#include "core/hle/kernel/shared_memory.h" 15#include "core/hle/kernel/shared_memory.h"
16#include "core/hle/service/hid/hid.h" 16#include "core/hle/service/hid/hid.h"
17#include "core/hle/service/hid/irs.h"
18#include "core/hle/service/hid/xcd.h"
17#include "core/hle/service/service.h" 19#include "core/hle/service/service.h"
18 20
19namespace Service::HID { 21namespace Service::HID {
@@ -555,10 +557,233 @@ private:
555 } 557 }
556}; 558};
557 559
560class HidDbg final : public ServiceFramework<HidDbg> {
561public:
562 explicit HidDbg() : ServiceFramework{"hid:dbg"} {
563 // clang-format off
564 static const FunctionInfo functions[] = {
565 {0, nullptr, "DeactivateDebugPad"},
566 {1, nullptr, "SetDebugPadAutoPilotState"},
567 {2, nullptr, "UnsetDebugPadAutoPilotState"},
568 {10, nullptr, "DeactivateTouchScreen"},
569 {11, nullptr, "SetTouchScreenAutoPilotState"},
570 {12, nullptr, "UnsetTouchScreenAutoPilotState"},
571 {20, nullptr, "DeactivateMouse"},
572 {21, nullptr, "SetMouseAutoPilotState"},
573 {22, nullptr, "UnsetMouseAutoPilotState"},
574 {30, nullptr, "DeactivateKeyboard"},
575 {31, nullptr, "SetKeyboardAutoPilotState"},
576 {32, nullptr, "UnsetKeyboardAutoPilotState"},
577 {50, nullptr, "DeactivateXpad"},
578 {51, nullptr, "SetXpadAutoPilotState"},
579 {52, nullptr, "UnsetXpadAutoPilotState"},
580 {60, nullptr, "DeactivateJoyXpad"},
581 {91, nullptr, "DeactivateGesture"},
582 {110, nullptr, "DeactivateHomeButton"},
583 {111, nullptr, "SetHomeButtonAutoPilotState"},
584 {112, nullptr, "UnsetHomeButtonAutoPilotState"},
585 {120, nullptr, "DeactivateSleepButton"},
586 {121, nullptr, "SetSleepButtonAutoPilotState"},
587 {122, nullptr, "UnsetSleepButtonAutoPilotState"},
588 {123, nullptr, "DeactivateInputDetector"},
589 {130, nullptr, "DeactivateCaptureButton"},
590 {131, nullptr, "SetCaptureButtonAutoPilotState"},
591 {132, nullptr, "UnsetCaptureButtonAutoPilotState"},
592 {133, nullptr, "SetShiftAccelerometerCalibrationValue"},
593 {134, nullptr, "GetShiftAccelerometerCalibrationValue"},
594 {135, nullptr, "SetShiftGyroscopeCalibrationValue"},
595 {136, nullptr, "GetShiftGyroscopeCalibrationValue"},
596 {140, nullptr, "DeactivateConsoleSixAxisSensor"},
597 {141, nullptr, "GetConsoleSixAxisSensorSamplingFrequency"},
598 {142, nullptr, "DeactivateSevenSixAxisSensor"},
599 {201, nullptr, "ActivateFirmwareUpdate"},
600 {202, nullptr, "DeactivateFirmwareUpdate"},
601 {203, nullptr, "StartFirmwareUpdate"},
602 {204, nullptr, "GetFirmwareUpdateStage"},
603 {205, nullptr, "GetFirmwareVersion"},
604 {206, nullptr, "GetDestinationFirmwareVersion"},
605 {207, nullptr, "DiscardFirmwareInfoCacheForRevert"},
606 {208, nullptr, "StartFirmwareUpdateForRevert"},
607 {209, nullptr, "GetAvailableFirmwareVersionForRevert"},
608 {210, nullptr, "IsFirmwareUpdatingDevice"},
609 {221, nullptr, "UpdateControllerColor"},
610 {222, nullptr, "ConnectUsbPadsAsync"},
611 {223, nullptr, "DisconnectUsbPadsAsync"},
612 {224, nullptr, "UpdateDesignInfo"},
613 {225, nullptr, "GetUniquePadDriverState"},
614 {226, nullptr, "GetSixAxisSensorDriverStates"},
615 {301, nullptr, "GetAbstractedPadHandles"},
616 {302, nullptr, "GetAbstractedPadState"},
617 {303, nullptr, "GetAbstractedPadsState"},
618 {321, nullptr, "SetAutoPilotVirtualPadState"},
619 {322, nullptr, "UnsetAutoPilotVirtualPadState"},
620 {323, nullptr, "UnsetAllAutoPilotVirtualPadState"},
621 {350, nullptr, "AddRegisteredDevice"},
622 };
623 // clang-format on
624
625 RegisterHandlers(functions);
626 }
627};
628
629class HidSys final : public ServiceFramework<HidSys> {
630public:
631 explicit HidSys() : ServiceFramework{"hid:sys"} {
632 // clang-format off
633 static const FunctionInfo functions[] = {
634 {31, nullptr, "SendKeyboardLockKeyEvent"},
635 {101, nullptr, "AcquireHomeButtonEventHandle"},
636 {111, nullptr, "ActivateHomeButton"},
637 {121, nullptr, "AcquireSleepButtonEventHandle"},
638 {131, nullptr, "ActivateSleepButton"},
639 {141, nullptr, "AcquireCaptureButtonEventHandle"},
640 {151, nullptr, "ActivateCaptureButton"},
641 {210, nullptr, "AcquireNfcDeviceUpdateEventHandle"},
642 {211, nullptr, "GetNpadsWithNfc"},
643 {212, nullptr, "AcquireNfcActivateEventHandle"},
644 {213, nullptr, "ActivateNfc"},
645 {214, nullptr, "GetXcdHandleForNpadWithNfc"},
646 {215, nullptr, "IsNfcActivated"},
647 {230, nullptr, "AcquireIrSensorEventHandle"},
648 {231, nullptr, "ActivateIrSensor"},
649 {301, nullptr, "ActivateNpadSystem"},
650 {303, nullptr, "ApplyNpadSystemCommonPolicy"},
651 {304, nullptr, "EnableAssigningSingleOnSlSrPress"},
652 {305, nullptr, "DisableAssigningSingleOnSlSrPress"},
653 {306, nullptr, "GetLastActiveNpad"},
654 {307, nullptr, "GetNpadSystemExtStyle"},
655 {308, nullptr, "ApplyNpadSystemCommonPolicyFull"},
656 {309, nullptr, "GetNpadFullKeyGripColor"},
657 {311, nullptr, "SetNpadPlayerLedBlinkingDevice"},
658 {321, nullptr, "GetUniquePadsFromNpad"},
659 {322, nullptr, "GetIrSensorState"},
660 {323, nullptr, "GetXcdHandleForNpadWithIrSensor"},
661 {500, nullptr, "SetAppletResourceUserId"},
662 {501, nullptr, "RegisterAppletResourceUserId"},
663 {502, nullptr, "UnregisterAppletResourceUserId"},
664 {503, nullptr, "EnableAppletToGetInput"},
665 {504, nullptr, "SetAruidValidForVibration"},
666 {505, nullptr, "EnableAppletToGetSixAxisSensor"},
667 {510, nullptr, "SetVibrationMasterVolume"},
668 {511, nullptr, "GetVibrationMasterVolume"},
669 {512, nullptr, "BeginPermitVibrationSession"},
670 {513, nullptr, "EndPermitVibrationSession"},
671 {520, nullptr, "EnableHandheldHids"},
672 {521, nullptr, "DisableHandheldHids"},
673 {540, nullptr, "AcquirePlayReportControllerUsageUpdateEvent"},
674 {541, nullptr, "GetPlayReportControllerUsages"},
675 {542, nullptr, "AcquirePlayReportRegisteredDeviceUpdateEvent"},
676 {543, nullptr, "GetRegisteredDevicesOld"},
677 {544, nullptr, "AcquireConnectionTriggerTimeoutEvent"},
678 {545, nullptr, "SendConnectionTrigger"},
679 {546, nullptr, "AcquireDeviceRegisteredEventForControllerSupport"},
680 {547, nullptr, "GetAllowedBluetoothLinksCount"},
681 {548, nullptr, "GetRegisteredDevices"},
682 {700, nullptr, "ActivateUniquePad"},
683 {702, nullptr, "AcquireUniquePadConnectionEventHandle"},
684 {703, nullptr, "GetUniquePadIds"},
685 {751, nullptr, "AcquireJoyDetachOnBluetoothOffEventHandle"},
686 {800, nullptr, "ListSixAxisSensorHandles"},
687 {801, nullptr, "IsSixAxisSensorUserCalibrationSupported"},
688 {802, nullptr, "ResetSixAxisSensorCalibrationValues"},
689 {803, nullptr, "StartSixAxisSensorUserCalibration"},
690 {804, nullptr, "CancelSixAxisSensorUserCalibration"},
691 {805, nullptr, "GetUniquePadBluetoothAddress"},
692 {806, nullptr, "DisconnectUniquePad"},
693 {807, nullptr, "GetUniquePadType"},
694 {808, nullptr, "GetUniquePadInterface"},
695 {809, nullptr, "GetUniquePadSerialNumber"},
696 {810, nullptr, "GetUniquePadControllerNumber"},
697 {811, nullptr, "GetSixAxisSensorUserCalibrationStage"},
698 {821, nullptr, "StartAnalogStickManualCalibration"},
699 {822, nullptr, "RetryCurrentAnalogStickManualCalibrationStage"},
700 {823, nullptr, "CancelAnalogStickManualCalibration"},
701 {824, nullptr, "ResetAnalogStickManualCalibration"},
702 {825, nullptr, "GetAnalogStickState"},
703 {826, nullptr, "GetAnalogStickManualCalibrationStage"},
704 {827, nullptr, "IsAnalogStickButtonPressed"},
705 {828, nullptr, "IsAnalogStickInReleasePosition"},
706 {829, nullptr, "IsAnalogStickInCircumference"},
707 {850, nullptr, "IsUsbFullKeyControllerEnabled"},
708 {851, nullptr, "EnableUsbFullKeyController"},
709 {852, nullptr, "IsUsbConnected"},
710 {900, nullptr, "ActivateInputDetector"},
711 {901, nullptr, "NotifyInputDetector"},
712 {1000, nullptr, "InitializeFirmwareUpdate"},
713 {1001, nullptr, "GetFirmwareVersion"},
714 {1002, nullptr, "GetAvailableFirmwareVersion"},
715 {1003, nullptr, "IsFirmwareUpdateAvailable"},
716 {1004, nullptr, "CheckFirmwareUpdateRequired"},
717 {1005, nullptr, "StartFirmwareUpdate"},
718 {1006, nullptr, "AbortFirmwareUpdate"},
719 {1007, nullptr, "GetFirmwareUpdateState"},
720 {1008, nullptr, "ActivateAudioControl"},
721 {1009, nullptr, "AcquireAudioControlEventHandle"},
722 {1010, nullptr, "GetAudioControlStates"},
723 {1011, nullptr, "DeactivateAudioControl"},
724 {1050, nullptr, "IsSixAxisSensorAccurateUserCalibrationSupported"},
725 {1051, nullptr, "StartSixAxisSensorAccurateUserCalibration"},
726 {1052, nullptr, "CancelSixAxisSensorAccurateUserCalibration"},
727 {1053, nullptr, "GetSixAxisSensorAccurateUserCalibrationState"},
728 {1100, nullptr, "GetHidbusSystemServiceObject"},
729 };
730 // clang-format on
731
732 RegisterHandlers(functions);
733 }
734};
735
736class HidTmp final : public ServiceFramework<HidTmp> {
737public:
738 explicit HidTmp() : ServiceFramework{"hid:tmp"} {
739 // clang-format off
740 static const FunctionInfo functions[] = {
741 {0, nullptr, "GetConsoleSixAxisSensorCalibrationValues"},
742 };
743 // clang-format on
744
745 RegisterHandlers(functions);
746 }
747};
748
749class HidBus final : public ServiceFramework<HidBus> {
750public:
751 explicit HidBus() : ServiceFramework{"hidbus"} {
752 // clang-format off
753 static const FunctionInfo functions[] = {
754 {1, nullptr, "GetBusHandle"},
755 {2, nullptr, "IsExternalDeviceConnected"},
756 {3, nullptr, "Initialize"},
757 {4, nullptr, "Finalize"},
758 {5, nullptr, "EnableExternalDevice"},
759 {6, nullptr, "GetExternalDeviceId"},
760 {7, nullptr, "SendCommandAsync"},
761 {8, nullptr, "GetSendCommandAsynceResult"},
762 {9, nullptr, "SetEventForSendCommandAsycResult"},
763 {10, nullptr, "GetSharedMemoryHandle"},
764 {11, nullptr, "EnableJoyPollingReceiveMode"},
765 {12, nullptr, "DisableJoyPollingReceiveMode"},
766 {13, nullptr, "GetPollingData"},
767 };
768 // clang-format on
769
770 RegisterHandlers(functions);
771 }
772};
773
558void ReloadInputDevices() {} 774void ReloadInputDevices() {}
559 775
560void InstallInterfaces(SM::ServiceManager& service_manager) { 776void InstallInterfaces(SM::ServiceManager& service_manager) {
561 std::make_shared<Hid>()->InstallAsService(service_manager); 777 std::make_shared<Hid>()->InstallAsService(service_manager);
778 std::make_shared<HidBus>()->InstallAsService(service_manager);
779 std::make_shared<HidDbg>()->InstallAsService(service_manager);
780 std::make_shared<HidSys>()->InstallAsService(service_manager);
781 std::make_shared<HidTmp>()->InstallAsService(service_manager);
782
783 std::make_shared<IRS>()->InstallAsService(service_manager);
784 std::make_shared<IRS_SYS>()->InstallAsService(service_manager);
785
786 std::make_shared<XCD_SYS>()->InstallAsService(service_manager);
562} 787}
563 788
564} // namespace Service::HID 789} // namespace Service::HID
diff --git a/src/core/hle/service/hid/irs.cpp b/src/core/hle/service/hid/irs.cpp
new file mode 100644
index 000000000..aaf311912
--- /dev/null
+++ b/src/core/hle/service/hid/irs.cpp
@@ -0,0 +1,49 @@
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/hid/irs.h"
6
7namespace Service::HID {
8
9IRS::IRS() : ServiceFramework{"irs"} {
10 // clang-format off
11 static const FunctionInfo functions[] = {
12 {302, nullptr, "ActivateIrsensor"},
13 {303, nullptr, "DeactivateIrsensor"},
14 {304, nullptr, "GetIrsensorSharedMemoryHandle"},
15 {305, nullptr, "StopImageProcessor"},
16 {306, nullptr, "RunMomentProcessor"},
17 {307, nullptr, "RunClusteringProcessor"},
18 {308, nullptr, "RunImageTransferProcessor"},
19 {309, nullptr, "GetImageTransferProcessorState"},
20 {310, nullptr, "RunTeraPluginProcessor"},
21 {311, nullptr, "GetNpadIrCameraHandle"},
22 {312, nullptr, "RunPointingProcessor"},
23 {313, nullptr, "SuspendImageProcessor"},
24 {314, nullptr, "CheckFirmwareVersion"},
25 {315, nullptr, "SetFunctionLevel"},
26 {316, nullptr, "RunImageTransferExProcessor"},
27 {317, nullptr, "RunIrLedProcessor"},
28 {318, nullptr, "StopImageProcessorAsync"},
29 {319, nullptr, "ActivateIrsensorWithFunctionLevel"},
30 };
31 // clang-format on
32
33 RegisterHandlers(functions);
34}
35
36IRS_SYS::IRS_SYS() : ServiceFramework{"irs:sys"} {
37 // clang-format off
38 static const FunctionInfo functions[] = {
39 {500, nullptr, "SetAppletResourceUserId"},
40 {501, nullptr, "RegisterAppletResourceUserId"},
41 {502, nullptr, "UnregisterAppletResourceUserId"},
42 {503, nullptr, "EnableAppletToGetInput"},
43 };
44 // clang-format on
45
46 RegisterHandlers(functions);
47}
48
49} // namespace Service::HID
diff --git a/src/core/hle/service/hid/irs.h b/src/core/hle/service/hid/irs.h
new file mode 100644
index 000000000..a8be701c7
--- /dev/null
+++ b/src/core/hle/service/hid/irs.h
@@ -0,0 +1,21 @@
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::HID {
10
11class IRS final : public ServiceFramework<IRS> {
12public:
13 explicit IRS();
14};
15
16class IRS_SYS final : public ServiceFramework<IRS_SYS> {
17public:
18 explicit IRS_SYS();
19};
20
21} // namespace Service::HID
diff --git a/src/core/hle/service/hid/xcd.cpp b/src/core/hle/service/hid/xcd.cpp
new file mode 100644
index 000000000..49f733f60
--- /dev/null
+++ b/src/core/hle/service/hid/xcd.cpp
@@ -0,0 +1,37 @@
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/hid/xcd.h"
6
7namespace Service::HID {
8
9XCD_SYS::XCD_SYS() : ServiceFramework{"xcd:sys"} {
10 // clang-format off
11 static const FunctionInfo functions[] = {
12 {0, nullptr, "GetDataFormat"},
13 {1, nullptr, "SetDataFormat"},
14 {2, nullptr, "GetMcuState"},
15 {3, nullptr, "SetMcuState"},
16 {4, nullptr, "GetMcuVersionForNfc"},
17 {5, nullptr, "CheckNfcDevicePower"},
18 {10, nullptr, "SetNfcEvent"},
19 {11, nullptr, "GetNfcInfo"},
20 {12, nullptr, "StartNfcDiscovery"},
21 {13, nullptr, "StopNfcDiscovery"},
22 {14, nullptr, "StartNtagRead"},
23 {15, nullptr, "StartNtagWrite"},
24 {16, nullptr, "SendNfcRawData"},
25 {17, nullptr, "RegisterMifareKey"},
26 {18, nullptr, "ClearMifareKey"},
27 {19, nullptr, "StartMifareRead"},
28 {20, nullptr, "StartMifareWrite"},
29 {101, nullptr, "GetAwakeTriggerReasonForLeftRail"},
30 {102, nullptr, "GetAwakeTriggerReasonForRightRail"},
31 };
32 // clang-format on
33
34 RegisterHandlers(functions);
35}
36
37} // namespace Service::HID
diff --git a/src/core/hle/service/hid/xcd.h b/src/core/hle/service/hid/xcd.h
new file mode 100644
index 000000000..232a044df
--- /dev/null
+++ b/src/core/hle/service/hid/xcd.h
@@ -0,0 +1,16 @@
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::HID {
10
11class XCD_SYS final : public ServiceFramework<XCD_SYS> {
12public:
13 explicit XCD_SYS();
14};
15
16} // namespace Service::HID
diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp
new file mode 100644
index 000000000..167f2c66a
--- /dev/null
+++ b/src/core/hle/service/ldn/ldn.cpp
@@ -0,0 +1,142 @@
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 <memory>
6
7#include "core/hle/ipc_helpers.h"
8#include "core/hle/result.h"
9#include "core/hle/service/ldn/ldn.h"
10#include "core/hle/service/sm/sm.h"
11
12namespace Service::LDN {
13
14class IMonitorService final : public ServiceFramework<IMonitorService> {
15public:
16 explicit IMonitorService() : ServiceFramework{"IMonitorService"} {
17 // clang-format off
18 static const FunctionInfo functions[] = {
19 {0, nullptr, "GetStateForMonitor"},
20 {1, nullptr, "GetNetworkInfoForMonitor"},
21 {2, nullptr, "GetIpv4AddressForMonitor"},
22 {3, nullptr, "GetDisconnectReasonForMonitor"},
23 {4, nullptr, "GetSecurityParameterForMonitor"},
24 {5, nullptr, "GetNetworkConfigForMonitor"},
25 {100, nullptr, "InitializeMonitor"},
26 {101, nullptr, "FinalizeMonitor"},
27 };
28 // clang-format on
29
30 RegisterHandlers(functions);
31 }
32};
33
34class LDNM final : public ServiceFramework<LDNM> {
35public:
36 explicit LDNM() : ServiceFramework{"ldn:m"} {
37 // clang-format off
38 static const FunctionInfo functions[] = {
39 {0, &LDNM::CreateMonitorService, "CreateMonitorService"}
40 };
41 // clang-format on
42
43 RegisterHandlers(functions);
44 }
45
46 void CreateMonitorService(Kernel::HLERequestContext& ctx) {
47 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
48 rb.Push(RESULT_SUCCESS);
49 rb.PushIpcInterface<IMonitorService>();
50
51 LOG_DEBUG(Service_LDN, "called");
52 }
53};
54
55class ILocalCommunicationService final : public ServiceFramework<ILocalCommunicationService> {
56public:
57 explicit ILocalCommunicationService(const char* name) : ServiceFramework{name} {
58 // clang-format off
59 static const FunctionInfo functions[] = {
60 {0, nullptr, "GetState"},
61 {1, nullptr, "GetNetworkInfo"},
62 {2, nullptr, "GetIpv4Address"},
63 {3, nullptr, "GetDisconnectReason"},
64 {4, nullptr, "GetSecurityParameter"},
65 {5, nullptr, "GetNetworkConfig"},
66 {100, nullptr, "AttachStateChangeEvent"},
67 {101, nullptr, "GetNetworkInfoLatestUpdate"},
68 {102, nullptr, "Scan"},
69 {103, nullptr, "ScanPrivate"},
70 {200, nullptr, "OpenAccessPoint"},
71 {201, nullptr, "CloseAccessPoint"},
72 {202, nullptr, "CreateNetwork"},
73 {203, nullptr, "CreateNetworkPrivate"},
74 {204, nullptr, "DestroyNetwork"},
75 {205, nullptr, "Reject"},
76 {206, nullptr, "SetAdvertiseData"},
77 {207, nullptr, "SetStationAcceptPolicy"},
78 {208, nullptr, "AddAcceptFilterEntry"},
79 {209, nullptr, "ClearAcceptFilter"},
80 {300, nullptr, "OpenStation"},
81 {301, nullptr, "CloseStation"},
82 {302, nullptr, "Connect"},
83 {303, nullptr, "ConnectPrivate"},
84 {304, nullptr, "Disconnect"},
85 {400, nullptr, "InitializeSystem"},
86 {401, nullptr, "FinalizeSystem"},
87 };
88 // clang-format on
89
90 RegisterHandlers(functions);
91 }
92};
93
94class LDNS final : public ServiceFramework<LDNS> {
95public:
96 explicit LDNS() : ServiceFramework{"ldn:s"} {
97 // clang-format off
98 static const FunctionInfo functions[] = {
99 {0, &LDNS::CreateSystemLocalCommunicationService, "CreateSystemLocalCommunicationService"},
100 };
101 // clang-format on
102
103 RegisterHandlers(functions);
104 }
105
106 void CreateSystemLocalCommunicationService(Kernel::HLERequestContext& ctx) {
107 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
108 rb.Push(RESULT_SUCCESS);
109 rb.PushIpcInterface<ILocalCommunicationService>("ISystemLocalCommunicationService");
110
111 LOG_DEBUG(Service_LDN, "called");
112 }
113};
114
115class LDNU final : public ServiceFramework<LDNU> {
116public:
117 explicit LDNU() : ServiceFramework{"ldn:u"} {
118 // clang-format off
119 static const FunctionInfo functions[] = {
120 {0, &LDNU::CreateUserLocalCommunicationService, "CreateUserLocalCommunicationService"},
121 };
122 // clang-format on
123
124 RegisterHandlers(functions);
125 }
126
127 void CreateUserLocalCommunicationService(Kernel::HLERequestContext& ctx) {
128 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
129 rb.Push(RESULT_SUCCESS);
130 rb.PushIpcInterface<ILocalCommunicationService>("IUserLocalCommunicationService");
131
132 LOG_DEBUG(Service_LDN, "called");
133 }
134};
135
136void InstallInterfaces(SM::ServiceManager& sm) {
137 std::make_shared<LDNM>()->InstallAsService(sm);
138 std::make_shared<LDNS>()->InstallAsService(sm);
139 std::make_shared<LDNU>()->InstallAsService(sm);
140}
141
142} // namespace Service::LDN
diff --git a/src/core/hle/service/ldn/ldn.h b/src/core/hle/service/ldn/ldn.h
new file mode 100644
index 000000000..6b2a3c2b2
--- /dev/null
+++ b/src/core/hle/service/ldn/ldn.h
@@ -0,0 +1,16 @@
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
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::LDN {
12
13/// Registers all LDN services with the specified service manager.
14void InstallInterfaces(SM::ServiceManager& sm);
15
16} // namespace Service::LDN
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index e85a8bdb9..b497376d7 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -4,10 +4,12 @@
4 4
5#include <sstream> 5#include <sstream>
6#include <string> 6#include <string>
7
7#include "common/logging/log.h" 8#include "common/logging/log.h"
8#include "core/hle/ipc_helpers.h" 9#include "core/hle/ipc_helpers.h"
9#include "core/hle/kernel/client_session.h"
10#include "core/hle/service/lm/lm.h" 10#include "core/hle/service/lm/lm.h"
11#include "core/hle/service/service.h"
12#include "core/memory.h"
11 13
12namespace Service::LM { 14namespace Service::LM {
13 15
@@ -15,13 +17,12 @@ class Logger final : public ServiceFramework<Logger> {
15public: 17public:
16 Logger() : ServiceFramework("Logger") { 18 Logger() : ServiceFramework("Logger") {
17 static const FunctionInfo functions[] = { 19 static const FunctionInfo functions[] = {
18 {0x00000000, &Logger::Log, "Log"}, 20 {0x00000000, &Logger::Initialize, "Initialize"},
21 {0x00000001, nullptr, "SetDestination"},
19 }; 22 };
20 RegisterHandlers(functions); 23 RegisterHandlers(functions);
21 } 24 }
22 25
23 ~Logger() = default;
24
25private: 26private:
26 struct MessageHeader { 27 struct MessageHeader {
27 enum Flags : u32_le { 28 enum Flags : u32_le {
@@ -66,13 +67,13 @@ private:
66 }; 67 };
67 68
68 /** 69 /**
69 * LM::Log service function 70 * ILogger::Initialize service function
70 * Inputs: 71 * Inputs:
71 * 0: 0x00000000 72 * 0: 0x00000000
72 * Outputs: 73 * Outputs:
73 * 0: ResultCode 74 * 0: ResultCode
74 */ 75 */
75 void Log(Kernel::HLERequestContext& ctx) { 76 void Initialize(Kernel::HLERequestContext& ctx) {
76 // This function only succeeds - Get that out of the way 77 // This function only succeeds - Get that out of the way
77 IPC::ResponseBuilder rb{ctx, 2}; 78 IPC::ResponseBuilder rb{ctx, 2};
78 rb.Push(RESULT_SUCCESS); 79 rb.Push(RESULT_SUCCESS);
@@ -162,30 +163,33 @@ private:
162 std::ostringstream log_stream; 163 std::ostringstream log_stream;
163}; 164};
164 165
165void InstallInterfaces(SM::ServiceManager& service_manager) { 166class LM final : public ServiceFramework<LM> {
166 std::make_shared<LM>()->InstallAsService(service_manager); 167public:
167} 168 explicit LM() : ServiceFramework{"lm"} {
169 static const FunctionInfo functions[] = {
170 {0x00000000, &LM::OpenLogger, "OpenLogger"},
171 };
172 RegisterHandlers(functions);
173 }
168 174
169/** 175 /**
170 * LM::Initialize service function 176 * LM::OpenLogger service function
171 * Inputs: 177 * Inputs:
172 * 0: 0x00000000 178 * 0: 0x00000000
173 * Outputs: 179 * Outputs:
174 * 0: ResultCode 180 * 0: ResultCode
175 */ 181 */
176void LM::Initialize(Kernel::HLERequestContext& ctx) { 182 void OpenLogger(Kernel::HLERequestContext& ctx) {
177 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 183 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
178 rb.Push(RESULT_SUCCESS); 184 rb.Push(RESULT_SUCCESS);
179 rb.PushIpcInterface<Logger>(); 185 rb.PushIpcInterface<Logger>();
180
181 LOG_DEBUG(Service_LM, "called");
182}
183 186
184LM::LM() : ServiceFramework("lm") { 187 LOG_DEBUG(Service_LM, "called");
185 static const FunctionInfo functions[] = { 188 }
186 {0x00000000, &LM::Initialize, "Initialize"}, 189};
187 }; 190
188 RegisterHandlers(functions); 191void InstallInterfaces(SM::ServiceManager& service_manager) {
192 std::make_shared<LM>()->InstallAsService(service_manager);
189} 193}
190 194
191} // namespace Service::LM 195} // namespace Service::LM
diff --git a/src/core/hle/service/lm/lm.h b/src/core/hle/service/lm/lm.h
index 63d6506fe..7806ae27b 100644
--- a/src/core/hle/service/lm/lm.h
+++ b/src/core/hle/service/lm/lm.h
@@ -4,21 +4,12 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <vector> 7namespace Service::SM {
8#include "core/hle/kernel/kernel.h" 8class ServiceManager;
9#include "core/hle/service/service.h" 9}
10 10
11namespace Service::LM { 11namespace Service::LM {
12 12
13class LM final : public ServiceFramework<LM> {
14public:
15 LM();
16 ~LM() = default;
17
18private:
19 void Initialize(Kernel::HLERequestContext& ctx);
20};
21
22/// Registers all LM services with the specified service manager. 13/// Registers all LM services with the specified service manager.
23void InstallInterfaces(SM::ServiceManager& service_manager); 14void InstallInterfaces(SM::ServiceManager& service_manager);
24 15
diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp
new file mode 100644
index 000000000..bd05b0a70
--- /dev/null
+++ b/src/core/hle/service/nim/nim.cpp
@@ -0,0 +1,124 @@
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/nim/nim.h"
6#include "core/hle/service/service.h"
7#include "core/hle/service/sm/sm.h"
8
9namespace Service::NIM {
10
11class NIM final : public ServiceFramework<NIM> {
12public:
13 explicit NIM() : ServiceFramework{"nim"} {
14 // clang-format off
15 static const FunctionInfo functions[] = {
16 {0, nullptr, "CreateSystemUpdateTask"},
17 {1, nullptr, "DestroySystemUpdateTask"},
18 {2, nullptr, "ListSystemUpdateTask"},
19 {3, nullptr, "RequestSystemUpdateTaskRun"},
20 {4, nullptr, "GetSystemUpdateTaskInfo"},
21 {5, nullptr, "CommitSystemUpdateTask"},
22 {6, nullptr, "CreateNetworkInstallTask"},
23 {7, nullptr, "DestroyNetworkInstallTask"},
24 {8, nullptr, "ListNetworkInstallTask"},
25 {9, nullptr, "RequestNetworkInstallTaskRun"},
26 {10, nullptr, "GetNetworkInstallTaskInfo"},
27 {11, nullptr, "CommitNetworkInstallTask"},
28 {12, nullptr, "RequestLatestSystemUpdateMeta"},
29 {14, nullptr, "ListApplicationNetworkInstallTask"},
30 {15, nullptr, "ListNetworkInstallTaskContentMeta"},
31 {16, nullptr, "RequestLatestVersion"},
32 {17, nullptr, "SetNetworkInstallTaskAttribute"},
33 {18, nullptr, "AddNetworkInstallTaskContentMeta"},
34 {19, nullptr, "GetDownloadedSystemDataPath"},
35 {20, nullptr, "CalculateNetworkInstallTaskRequiredSize"},
36 {21, nullptr, "IsExFatDriverIncluded"},
37 {22, nullptr, "GetBackgroundDownloadStressTaskInfo"},
38 {23, nullptr, "RequestDeviceAuthenticationToken"},
39 {24, nullptr, "RequestGameCardRegistrationStatus"},
40 {25, nullptr, "RequestRegisterGameCard"},
41 {26, nullptr, "RequestRegisterNotificationToken"},
42 {27, nullptr, "RequestDownloadTaskList"},
43 {28, nullptr, "RequestApplicationControl"},
44 {29, nullptr, "RequestLatestApplicationControl"},
45 {30, nullptr, "RequestVersionList"},
46 {31, nullptr, "CreateApplyDeltaTask"},
47 {32, nullptr, "DestroyApplyDeltaTask"},
48 {33, nullptr, "ListApplicationApplyDeltaTask"},
49 {34, nullptr, "RequestApplyDeltaTaskRun"},
50 {35, nullptr, "GetApplyDeltaTaskInfo"},
51 {36, nullptr, "ListApplyDeltaTask"},
52 {37, nullptr, "CommitApplyDeltaTask"},
53 {38, nullptr, "CalculateApplyDeltaTaskRequiredSize"},
54 {39, nullptr, "PrepareShutdown"},
55 {40, nullptr, "ListApplyDeltaTask"},
56 {41, nullptr, "ClearNotEnoughSpaceStateOfApplyDeltaTask"},
57 {42, nullptr, "Unknown1"},
58 {43, nullptr, "Unknown2"},
59 {44, nullptr, "Unknown3"},
60 {45, nullptr, "Unknown4"},
61 {46, nullptr, "Unknown5"},
62 };
63 // clang-format on
64
65 RegisterHandlers(functions);
66 }
67};
68
69class NIM_SHP final : public ServiceFramework<NIM_SHP> {
70public:
71 explicit NIM_SHP() : ServiceFramework{"nim:shp"} {
72 // clang-format off
73 static const FunctionInfo functions[] = {
74 {0, nullptr, "RequestDeviceAuthenticationToken"},
75 {1, nullptr, "RequestCachedDeviceAuthenticationToken"},
76 {100, nullptr, "RequestRegisterDeviceAccount"},
77 {101, nullptr, "RequestUnregisterDeviceAccount"},
78 {102, nullptr, "RequestDeviceAccountStatus"},
79 {103, nullptr, "GetDeviceAccountInfo"},
80 {104, nullptr, "RequestDeviceRegistrationInfo"},
81 {105, nullptr, "RequestTransferDeviceAccount"},
82 {106, nullptr, "RequestSyncRegistration"},
83 {107, nullptr, "IsOwnDeviceId"},
84 {200, nullptr, "RequestRegisterNotificationToken"},
85 {300, nullptr, "RequestUnlinkDevice"},
86 {301, nullptr, "RequestUnlinkDeviceIntegrated"},
87 {302, nullptr, "RequestLinkDevice"},
88 {303, nullptr, "HasDeviceLink"},
89 {304, nullptr, "RequestUnlinkDeviceAll"},
90 {305, nullptr, "RequestCreateVirtualAccount"},
91 {306, nullptr, "RequestDeviceLinkStatus"},
92 {400, nullptr, "GetAccountByVirtualAccount"},
93 {500, nullptr, "RequestSyncTicket"},
94 {501, nullptr, "RequestDownloadTicket"},
95 {502, nullptr, "RequestDownloadTicketForPrepurchasedContents"},
96 };
97 // clang-format on
98
99 RegisterHandlers(functions);
100 }
101};
102
103class NTC final : public ServiceFramework<NTC> {
104public:
105 explicit NTC() : ServiceFramework{"ntc"} {
106 // clang-format off
107 static const FunctionInfo functions[] = {
108 {0, nullptr, "OpenEnsureNetworkClockAvailabilityService"},
109 {100, nullptr, "SuspendAutonomicTimeCorrection"},
110 {101, nullptr, "ResumeAutonomicTimeCorrection"},
111 };
112 // clang-format on
113
114 RegisterHandlers(functions);
115 }
116};
117
118void InstallInterfaces(SM::ServiceManager& sm) {
119 std::make_shared<NIM>()->InstallAsService(sm);
120 std::make_shared<NIM_SHP>()->InstallAsService(sm);
121 std::make_shared<NTC>()->InstallAsService(sm);
122}
123
124} // namespace Service::NIM
diff --git a/src/core/hle/service/nim/nim.h b/src/core/hle/service/nim/nim.h
new file mode 100644
index 000000000..2a2a92df0
--- /dev/null
+++ b/src/core/hle/service/nim/nim.h
@@ -0,0 +1,15 @@
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
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::NIM {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // namespace Service::NIM
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 482989ea7..8b84fd349 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -27,12 +27,15 @@
27#include "core/hle/service/fatal/fatal.h" 27#include "core/hle/service/fatal/fatal.h"
28#include "core/hle/service/filesystem/filesystem.h" 28#include "core/hle/service/filesystem/filesystem.h"
29#include "core/hle/service/friend/friend.h" 29#include "core/hle/service/friend/friend.h"
30#include "core/hle/service/grc/grc.h"
30#include "core/hle/service/hid/hid.h" 31#include "core/hle/service/hid/hid.h"
32#include "core/hle/service/ldn/ldn.h"
31#include "core/hle/service/ldr/ldr.h" 33#include "core/hle/service/ldr/ldr.h"
32#include "core/hle/service/lm/lm.h" 34#include "core/hle/service/lm/lm.h"
33#include "core/hle/service/mm/mm_u.h" 35#include "core/hle/service/mm/mm_u.h"
34#include "core/hle/service/nfp/nfp.h" 36#include "core/hle/service/nfp/nfp.h"
35#include "core/hle/service/nifm/nifm.h" 37#include "core/hle/service/nifm/nifm.h"
38#include "core/hle/service/nim/nim.h"
36#include "core/hle/service/ns/ns.h" 39#include "core/hle/service/ns/ns.h"
37#include "core/hle/service/nvdrv/nvdrv.h" 40#include "core/hle/service/nvdrv/nvdrv.h"
38#include "core/hle/service/pctl/pctl.h" 41#include "core/hle/service/pctl/pctl.h"
@@ -198,12 +201,15 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
198 Fatal::InstallInterfaces(*sm); 201 Fatal::InstallInterfaces(*sm);
199 FileSystem::InstallInterfaces(*sm); 202 FileSystem::InstallInterfaces(*sm);
200 Friend::InstallInterfaces(*sm); 203 Friend::InstallInterfaces(*sm);
204 GRC::InstallInterfaces(*sm);
201 HID::InstallInterfaces(*sm); 205 HID::InstallInterfaces(*sm);
206 LDN::InstallInterfaces(*sm);
202 LDR::InstallInterfaces(*sm); 207 LDR::InstallInterfaces(*sm);
203 LM::InstallInterfaces(*sm); 208 LM::InstallInterfaces(*sm);
204 MM::InstallInterfaces(*sm); 209 MM::InstallInterfaces(*sm);
205 NFP::InstallInterfaces(*sm); 210 NFP::InstallInterfaces(*sm);
206 NIFM::InstallInterfaces(*sm); 211 NIFM::InstallInterfaces(*sm);
212 NIM::InstallInterfaces(*sm);
207 NS::InstallInterfaces(*sm); 213 NS::InstallInterfaces(*sm);
208 Nvidia::InstallInterfaces(*sm); 214 Nvidia::InstallInterfaces(*sm);
209 PCTL::InstallInterfaces(*sm); 215 PCTL::InstallInterfaces(*sm);
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp
index 6aa1e2511..3211a8346 100644
--- a/src/core/hle/service/sockets/bsd.cpp
+++ b/src/core/hle/service/sockets/bsd.cpp
@@ -109,4 +109,26 @@ BSD::BSD(const char* name) : ServiceFramework(name) {
109 RegisterHandlers(functions); 109 RegisterHandlers(functions);
110} 110}
111 111
112BSDCFG::BSDCFG() : ServiceFramework{"bsdcfg"} {
113 // clang-format off
114 static const FunctionInfo functions[] = {
115 {0, nullptr, "SetIfUp"},
116 {1, nullptr, "SetIfUpWithEvent"},
117 {2, nullptr, "CancelIf"},
118 {3, nullptr, "SetIfDown"},
119 {4, nullptr, "GetIfState"},
120 {5, nullptr, "DhcpRenew"},
121 {6, nullptr, "AddStaticArpEntry"},
122 {7, nullptr, "RemoveArpEntry"},
123 {8, nullptr, "LookupArpEntry"},
124 {9, nullptr, "LookupArpEntry2"},
125 {10, nullptr, "ClearArpEntries"},
126 {11, nullptr, "ClearArpEntries2"},
127 {12, nullptr, "PrintArpEntries"},
128 };
129 // clang-format on
130
131 RegisterHandlers(functions);
132}
133
112} // namespace Service::Sockets 134} // namespace Service::Sockets
diff --git a/src/core/hle/service/sockets/bsd.h b/src/core/hle/service/sockets/bsd.h
index a6b1ca7d0..c1da59b24 100644
--- a/src/core/hle/service/sockets/bsd.h
+++ b/src/core/hle/service/sockets/bsd.h
@@ -26,4 +26,9 @@ private:
26 u32 next_fd = 1; 26 u32 next_fd = 1;
27}; 27};
28 28
29class BSDCFG final : public ServiceFramework<BSDCFG> {
30public:
31 explicit BSDCFG();
32};
33
29} // namespace Service::Sockets 34} // namespace Service::Sockets
diff --git a/src/core/hle/service/sockets/ethc.cpp b/src/core/hle/service/sockets/ethc.cpp
new file mode 100644
index 000000000..d53c25eec
--- /dev/null
+++ b/src/core/hle/service/sockets/ethc.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 "core/hle/service/sockets/ethc.h"
6
7namespace Service::Sockets {
8
9ETHC_C::ETHC_C() : ServiceFramework{"ethc:c"} {
10 // clang-format off
11 static const FunctionInfo functions[] = {
12 {0, nullptr, "Initialize"},
13 {1, nullptr, "Cancel"},
14 {2, nullptr, "GetResult"},
15 {3, nullptr, "GetMediaList"},
16 {4, nullptr, "SetMediaType"},
17 {5, nullptr, "GetMediaType"},
18 };
19 // clang-format on
20
21 RegisterHandlers(functions);
22}
23
24ETHC_I::ETHC_I() : ServiceFramework{"ethc:i"} {
25 // clang-format off
26 static const FunctionInfo functions[] = {
27 {0, nullptr, "GetReadableHandle"},
28 {1, nullptr, "Cancel"},
29 {2, nullptr, "GetResult"},
30 {3, nullptr, "GetInterfaceList"},
31 {4, nullptr, "GetInterfaceCount"},
32 };
33 // clang-format on
34
35 RegisterHandlers(functions);
36}
37
38} // namespace Service::Sockets
diff --git a/src/core/hle/service/sockets/ethc.h b/src/core/hle/service/sockets/ethc.h
new file mode 100644
index 000000000..9a3c88100
--- /dev/null
+++ b/src/core/hle/service/sockets/ethc.h
@@ -0,0 +1,21 @@
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::Sockets {
10
11class ETHC_C final : public ServiceFramework<ETHC_C> {
12public:
13 explicit ETHC_C();
14};
15
16class ETHC_I final : public ServiceFramework<ETHC_I> {
17public:
18 explicit ETHC_I();
19};
20
21} // namespace Service::Sockets
diff --git a/src/core/hle/service/sockets/sockets.cpp b/src/core/hle/service/sockets/sockets.cpp
index 05bd10d35..08d2d306a 100644
--- a/src/core/hle/service/sockets/sockets.cpp
+++ b/src/core/hle/service/sockets/sockets.cpp
@@ -3,6 +3,7 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/sockets/bsd.h" 5#include "core/hle/service/sockets/bsd.h"
6#include "core/hle/service/sockets/ethc.h"
6#include "core/hle/service/sockets/nsd.h" 7#include "core/hle/service/sockets/nsd.h"
7#include "core/hle/service/sockets/sfdnsres.h" 8#include "core/hle/service/sockets/sfdnsres.h"
8#include "core/hle/service/sockets/sockets.h" 9#include "core/hle/service/sockets/sockets.h"
@@ -12,8 +13,14 @@ namespace Service::Sockets {
12void InstallInterfaces(SM::ServiceManager& service_manager) { 13void InstallInterfaces(SM::ServiceManager& service_manager) {
13 std::make_shared<BSD>("bsd:s")->InstallAsService(service_manager); 14 std::make_shared<BSD>("bsd:s")->InstallAsService(service_manager);
14 std::make_shared<BSD>("bsd:u")->InstallAsService(service_manager); 15 std::make_shared<BSD>("bsd:u")->InstallAsService(service_manager);
16 std::make_shared<BSDCFG>()->InstallAsService(service_manager);
17
18 std::make_shared<ETHC_C>()->InstallAsService(service_manager);
19 std::make_shared<ETHC_I>()->InstallAsService(service_manager);
20
15 std::make_shared<NSD>("nsd:a")->InstallAsService(service_manager); 21 std::make_shared<NSD>("nsd:a")->InstallAsService(service_manager);
16 std::make_shared<NSD>("nsd:u")->InstallAsService(service_manager); 22 std::make_shared<NSD>("nsd:u")->InstallAsService(service_manager);
23
17 std::make_shared<SFDNSRES>()->InstallAsService(service_manager); 24 std::make_shared<SFDNSRES>()->InstallAsService(service_manager);
18} 25}
19 26
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index e9d87efb4..c464fc6d1 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -23,7 +23,13 @@ enum class RenderTargetFormat : u32 {
23 RGB10_A2_UNORM = 0xD1, 23 RGB10_A2_UNORM = 0xD1,
24 RGBA8_UNORM = 0xD5, 24 RGBA8_UNORM = 0xD5,
25 RGBA8_SRGB = 0xD6, 25 RGBA8_SRGB = 0xD6,
26 RG16_UNORM = 0xDA,
27 RG16_SNORM = 0xDB,
28 RG16_SINT = 0xDC,
29 RG16_UINT = 0xDD,
30 RG16_FLOAT = 0xDE,
26 R11G11B10_FLOAT = 0xE0, 31 R11G11B10_FLOAT = 0xE0,
32 R16_FLOAT = 0xF2,
27 R8_UNORM = 0xF3, 33 R8_UNORM = 0xF3,
28}; 34};
29 35
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp
index 2f814a184..ca923d17d 100644
--- a/src/video_core/memory_manager.cpp
+++ b/src/video_core/memory_manager.cpp
@@ -13,8 +13,10 @@ GPUVAddr MemoryManager::AllocateSpace(u64 size, u64 align) {
13 ASSERT(gpu_addr); 13 ASSERT(gpu_addr);
14 14
15 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) { 15 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) {
16 ASSERT(PageSlot(*gpu_addr + offset) == static_cast<u64>(PageStatus::Unmapped)); 16 VAddr& slot = PageSlot(*gpu_addr + offset);
17 PageSlot(*gpu_addr + offset) = static_cast<u64>(PageStatus::Allocated); 17
18 ASSERT(slot == static_cast<u64>(PageStatus::Unmapped));
19 slot = static_cast<u64>(PageStatus::Allocated);
18 } 20 }
19 21
20 return *gpu_addr; 22 return *gpu_addr;
@@ -22,8 +24,10 @@ GPUVAddr MemoryManager::AllocateSpace(u64 size, u64 align) {
22 24
23GPUVAddr MemoryManager::AllocateSpace(GPUVAddr gpu_addr, u64 size, u64 align) { 25GPUVAddr MemoryManager::AllocateSpace(GPUVAddr gpu_addr, u64 size, u64 align) {
24 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) { 26 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) {
25 ASSERT(PageSlot(gpu_addr + offset) == static_cast<u64>(PageStatus::Unmapped)); 27 VAddr& slot = PageSlot(gpu_addr + offset);
26 PageSlot(gpu_addr + offset) = static_cast<u64>(PageStatus::Allocated); 28
29 ASSERT(slot == static_cast<u64>(PageStatus::Unmapped));
30 slot = static_cast<u64>(PageStatus::Allocated);
27 } 31 }
28 32
29 return gpu_addr; 33 return gpu_addr;
@@ -34,8 +38,10 @@ GPUVAddr MemoryManager::MapBufferEx(VAddr cpu_addr, u64 size) {
34 ASSERT(gpu_addr); 38 ASSERT(gpu_addr);
35 39
36 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) { 40 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) {
37 ASSERT(PageSlot(*gpu_addr + offset) == static_cast<u64>(PageStatus::Unmapped)); 41 VAddr& slot = PageSlot(*gpu_addr + offset);
38 PageSlot(*gpu_addr + offset) = cpu_addr + offset; 42
43 ASSERT(slot == static_cast<u64>(PageStatus::Unmapped));
44 slot = cpu_addr + offset;
39 } 45 }
40 46
41 MappedRegion region{cpu_addr, *gpu_addr, size}; 47 MappedRegion region{cpu_addr, *gpu_addr, size};
@@ -48,8 +54,10 @@ GPUVAddr MemoryManager::MapBufferEx(VAddr cpu_addr, GPUVAddr gpu_addr, u64 size)
48 ASSERT((gpu_addr & PAGE_MASK) == 0); 54 ASSERT((gpu_addr & PAGE_MASK) == 0);
49 55
50 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) { 56 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) {
51 ASSERT(PageSlot(gpu_addr + offset) == static_cast<u64>(PageStatus::Allocated)); 57 VAddr& slot = PageSlot(gpu_addr + offset);
52 PageSlot(gpu_addr + offset) = cpu_addr + offset; 58
59 ASSERT(slot == static_cast<u64>(PageStatus::Allocated));
60 slot = cpu_addr + offset;
53 } 61 }
54 62
55 MappedRegion region{cpu_addr, gpu_addr, size}; 63 MappedRegion region{cpu_addr, gpu_addr, size};
@@ -62,9 +70,11 @@ GPUVAddr MemoryManager::UnmapBuffer(GPUVAddr gpu_addr, u64 size) {
62 ASSERT((gpu_addr & PAGE_MASK) == 0); 70 ASSERT((gpu_addr & PAGE_MASK) == 0);
63 71
64 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) { 72 for (u64 offset = 0; offset < size; offset += PAGE_SIZE) {
65 ASSERT(PageSlot(gpu_addr + offset) != static_cast<u64>(PageStatus::Allocated) && 73 VAddr& slot = PageSlot(gpu_addr + offset);
66 PageSlot(gpu_addr + offset) != static_cast<u64>(PageStatus::Unmapped)); 74
67 PageSlot(gpu_addr + offset) = static_cast<u64>(PageStatus::Unmapped); 75 ASSERT(slot != static_cast<u64>(PageStatus::Allocated) &&
76 slot != static_cast<u64>(PageStatus::Unmapped));
77 slot = static_cast<u64>(PageStatus::Unmapped);
68 } 78 }
69 79
70 // Delete the region mappings that are contained within the unmapped region 80 // Delete the region mappings that are contained within the unmapped region
@@ -128,9 +138,7 @@ VAddr& MemoryManager::PageSlot(GPUVAddr gpu_addr) {
128 auto& block = page_table[(gpu_addr >> (PAGE_BITS + PAGE_TABLE_BITS)) & PAGE_TABLE_MASK]; 138 auto& block = page_table[(gpu_addr >> (PAGE_BITS + PAGE_TABLE_BITS)) & PAGE_TABLE_MASK];
129 if (!block) { 139 if (!block) {
130 block = std::make_unique<PageBlock>(); 140 block = std::make_unique<PageBlock>();
131 for (unsigned index = 0; index < PAGE_BLOCK_SIZE; index++) { 141 block->fill(static_cast<VAddr>(PageStatus::Unmapped));
132 (*block)[index] = static_cast<u64>(PageStatus::Unmapped);
133 }
134 } 142 }
135 return (*block)[(gpu_addr >> PAGE_BITS) & PAGE_BLOCK_MASK]; 143 return (*block)[(gpu_addr >> PAGE_BITS) & PAGE_BLOCK_MASK];
136} 144}
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index f52ac23f1..a4d9707cb 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -104,15 +104,20 @@ static constexpr std::array<FormatTuple, SurfaceParams::MaxPixelFormat> tex_form
104 true}, // DXT45 104 true}, // DXT45
105 {GL_COMPRESSED_RED_RGTC1, GL_RED, GL_UNSIGNED_INT_8_8_8_8, ComponentType::UNorm, true}, // DXN1 105 {GL_COMPRESSED_RED_RGTC1, GL_RED, GL_UNSIGNED_INT_8_8_8_8, ComponentType::UNorm, true}, // DXN1
106 {GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_RGB, GL_UNSIGNED_INT_8_8_8_8, ComponentType::UNorm, 106 {GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_RGB, GL_UNSIGNED_INT_8_8_8_8, ComponentType::UNorm,
107 true}, // BC7U 107 true}, // BC7U
108 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_4X4 108 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_4X4
109 {GL_RG8, GL_RG, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // G8R8 109 {GL_RG8, GL_RG, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // G8R8
110 {GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // BGRA8 110 {GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // BGRA8
111 {GL_RGBA32F, GL_RGBA, GL_FLOAT, ComponentType::Float, false}, // RGBA32F 111 {GL_RGBA32F, GL_RGBA, GL_FLOAT, ComponentType::Float, false}, // RGBA32F
112 {GL_RG32F, GL_RG, GL_FLOAT, ComponentType::Float, false}, // RG32F 112 {GL_RG32F, GL_RG, GL_FLOAT, ComponentType::Float, false}, // RG32F
113 {GL_R32F, GL_RED, GL_FLOAT, ComponentType::Float, false}, // R32F 113 {GL_R32F, GL_RED, GL_FLOAT, ComponentType::Float, false}, // R32F
114 {GL_R16F, GL_RED, GL_HALF_FLOAT, ComponentType::Float, false}, // R16F 114 {GL_R16F, GL_RED, GL_HALF_FLOAT, ComponentType::Float, false}, // R16F
115 {GL_R16, GL_RED, GL_UNSIGNED_SHORT, ComponentType::UNorm, false}, // R16UNORM 115 {GL_R16, GL_RED, GL_UNSIGNED_SHORT, ComponentType::UNorm, false}, // R16UNORM
116 {GL_RG16, GL_RG, GL_UNSIGNED_SHORT, ComponentType::UNorm, false}, // RG16
117 {GL_RG16F, GL_RG, GL_HALF_FLOAT, ComponentType::Float, false}, // RG16F
118 {GL_RG16UI, GL_RG_INTEGER, GL_UNSIGNED_SHORT, ComponentType::UInt, false}, // RG16UI
119 {GL_RG16I, GL_RG_INTEGER, GL_SHORT, ComponentType::SInt, false}, // RG16I
120 {GL_RG16_SNORM, GL_RG, GL_SHORT, ComponentType::SNorm, false}, // RG16S
116 {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, ComponentType::UNorm, false}, // SRGBA8 121 {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, ComponentType::UNorm, false}, // SRGBA8
117 122
118 // DepthStencil formats 123 // DepthStencil formats
@@ -210,10 +215,12 @@ static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr),
210 MortonCopy<true, PixelFormat::G8R8>, MortonCopy<true, PixelFormat::BGRA8>, 215 MortonCopy<true, PixelFormat::G8R8>, MortonCopy<true, PixelFormat::BGRA8>,
211 MortonCopy<true, PixelFormat::RGBA32F>, MortonCopy<true, PixelFormat::RG32F>, 216 MortonCopy<true, PixelFormat::RGBA32F>, MortonCopy<true, PixelFormat::RG32F>,
212 MortonCopy<true, PixelFormat::R32F>, MortonCopy<true, PixelFormat::R16F>, 217 MortonCopy<true, PixelFormat::R32F>, MortonCopy<true, PixelFormat::R16F>,
213 MortonCopy<true, PixelFormat::R16UNORM>, MortonCopy<true, PixelFormat::SRGBA8>, 218 MortonCopy<true, PixelFormat::R16UNORM>, MortonCopy<true, PixelFormat::RG16>,
214 MortonCopy<true, PixelFormat::Z24S8>, MortonCopy<true, PixelFormat::S8Z24>, 219 MortonCopy<true, PixelFormat::RG16F>, MortonCopy<true, PixelFormat::RG16UI>,
215 MortonCopy<true, PixelFormat::Z32F>, MortonCopy<true, PixelFormat::Z16>, 220 MortonCopy<true, PixelFormat::RG16I>, MortonCopy<true, PixelFormat::RG16S>,
216 MortonCopy<true, PixelFormat::Z32FS8>, 221 MortonCopy<true, PixelFormat::SRGBA8>, MortonCopy<true, PixelFormat::Z24S8>,
222 MortonCopy<true, PixelFormat::S8Z24>, MortonCopy<true, PixelFormat::Z32F>,
223 MortonCopy<true, PixelFormat::Z16>, MortonCopy<true, PixelFormat::Z32FS8>,
217}; 224};
218 225
219static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr), 226static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr),
@@ -241,6 +248,11 @@ static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr),
241 MortonCopy<false, PixelFormat::R32F>, 248 MortonCopy<false, PixelFormat::R32F>,
242 MortonCopy<false, PixelFormat::R16F>, 249 MortonCopy<false, PixelFormat::R16F>,
243 MortonCopy<false, PixelFormat::R16UNORM>, 250 MortonCopy<false, PixelFormat::R16UNORM>,
251 MortonCopy<false, PixelFormat::RG16>,
252 MortonCopy<false, PixelFormat::RG16F>,
253 MortonCopy<false, PixelFormat::RG16UI>,
254 MortonCopy<false, PixelFormat::RG16I>,
255 MortonCopy<false, PixelFormat::RG16S>,
244 MortonCopy<false, PixelFormat::SRGBA8>, 256 MortonCopy<false, PixelFormat::SRGBA8>,
245 MortonCopy<false, PixelFormat::Z24S8>, 257 MortonCopy<false, PixelFormat::Z24S8>,
246 MortonCopy<false, PixelFormat::S8Z24>, 258 MortonCopy<false, PixelFormat::S8Z24>,
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index ffa2019f7..bf0458b94 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -43,16 +43,21 @@ struct SurfaceParams {
43 R32F = 18, 43 R32F = 18,
44 R16F = 19, 44 R16F = 19,
45 R16UNORM = 20, 45 R16UNORM = 20,
46 SRGBA8 = 21, 46 RG16 = 21,
47 RG16F = 22,
48 RG16UI = 23,
49 RG16I = 24,
50 RG16S = 25,
51 SRGBA8 = 26,
47 52
48 MaxColorFormat, 53 MaxColorFormat,
49 54
50 // DepthStencil formats 55 // DepthStencil formats
51 Z24S8 = 22, 56 Z24S8 = 27,
52 S8Z24 = 23, 57 S8Z24 = 28,
53 Z32F = 24, 58 Z32F = 29,
54 Z16 = 25, 59 Z16 = 30,
55 Z32FS8 = 26, 60 Z32FS8 = 31,
56 61
57 MaxDepthStencilFormat, 62 MaxDepthStencilFormat,
58 63
@@ -111,6 +116,11 @@ struct SurfaceParams {
111 1, // R32F 116 1, // R32F
112 1, // R16F 117 1, // R16F
113 1, // R16UNORM 118 1, // R16UNORM
119 1, // RG16
120 1, // RG16F
121 1, // RG16UI
122 1, // RG16I
123 1, // RG16S
114 1, // SRGBA8 124 1, // SRGBA8
115 1, // Z24S8 125 1, // Z24S8
116 1, // S8Z24 126 1, // S8Z24
@@ -149,6 +159,11 @@ struct SurfaceParams {
149 32, // R32F 159 32, // R32F
150 16, // R16F 160 16, // R16F
151 16, // R16UNORM 161 16, // R16UNORM
162 32, // RG16
163 32, // RG16F
164 32, // RG16UI
165 32, // RG16I
166 32, // RG16S
152 32, // SRGBA8 167 32, // SRGBA8
153 32, // Z24S8 168 32, // Z24S8
154 32, // S8Z24 169 32, // S8Z24
@@ -205,6 +220,18 @@ struct SurfaceParams {
205 return PixelFormat::RGBA32UI; 220 return PixelFormat::RGBA32UI;
206 case Tegra::RenderTargetFormat::R8_UNORM: 221 case Tegra::RenderTargetFormat::R8_UNORM:
207 return PixelFormat::R8; 222 return PixelFormat::R8;
223 case Tegra::RenderTargetFormat::RG16_FLOAT:
224 return PixelFormat::RG16F;
225 case Tegra::RenderTargetFormat::RG16_UINT:
226 return PixelFormat::RG16UI;
227 case Tegra::RenderTargetFormat::RG16_SINT:
228 return PixelFormat::RG16I;
229 case Tegra::RenderTargetFormat::RG16_UNORM:
230 return PixelFormat::RG16;
231 case Tegra::RenderTargetFormat::RG16_SNORM:
232 return PixelFormat::RG16S;
233 case Tegra::RenderTargetFormat::R16_FLOAT:
234 return PixelFormat::R16F;
208 default: 235 default:
209 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 236 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
210 UNREACHABLE(); 237 UNREACHABLE();
@@ -271,6 +298,22 @@ struct SurfaceParams {
271 return PixelFormat::BC7U; 298 return PixelFormat::BC7U;
272 case Tegra::Texture::TextureFormat::ASTC_2D_4X4: 299 case Tegra::Texture::TextureFormat::ASTC_2D_4X4:
273 return PixelFormat::ASTC_2D_4X4; 300 return PixelFormat::ASTC_2D_4X4;
301 case Tegra::Texture::TextureFormat::R16_G16:
302 switch (component_type) {
303 case Tegra::Texture::ComponentType::FLOAT:
304 return PixelFormat::RG16F;
305 case Tegra::Texture::ComponentType::UNORM:
306 return PixelFormat::RG16;
307 case Tegra::Texture::ComponentType::SNORM:
308 return PixelFormat::RG16S;
309 case Tegra::Texture::ComponentType::UINT:
310 return PixelFormat::RG16UI;
311 case Tegra::Texture::ComponentType::SINT:
312 return PixelFormat::RG16I;
313 }
314 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}",
315 static_cast<u32>(component_type));
316 UNREACHABLE();
274 default: 317 default:
275 LOG_CRITICAL(HW_GPU, "Unimplemented format={}, component_type={}", 318 LOG_CRITICAL(HW_GPU, "Unimplemented format={}, component_type={}",
276 static_cast<u32>(format), static_cast<u32>(component_type)); 319 static_cast<u32>(format), static_cast<u32>(component_type));
@@ -329,6 +372,12 @@ struct SurfaceParams {
329 return Tegra::Texture::TextureFormat::ZF32; 372 return Tegra::Texture::TextureFormat::ZF32;
330 case PixelFormat::Z24S8: 373 case PixelFormat::Z24S8:
331 return Tegra::Texture::TextureFormat::Z24S8; 374 return Tegra::Texture::TextureFormat::Z24S8;
375 case PixelFormat::RG16F:
376 case PixelFormat::RG16:
377 case PixelFormat::RG16UI:
378 case PixelFormat::RG16I:
379 case PixelFormat::RG16S:
380 return Tegra::Texture::TextureFormat::R16_G16;
332 default: 381 default:
333 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 382 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
334 UNREACHABLE(); 383 UNREACHABLE();
@@ -360,6 +409,12 @@ struct SurfaceParams {
360 return ComponentType::UNorm; 409 return ComponentType::UNorm;
361 case Tegra::Texture::ComponentType::FLOAT: 410 case Tegra::Texture::ComponentType::FLOAT:
362 return ComponentType::Float; 411 return ComponentType::Float;
412 case Tegra::Texture::ComponentType::SNORM:
413 return ComponentType::SNorm;
414 case Tegra::Texture::ComponentType::UINT:
415 return ComponentType::UInt;
416 case Tegra::Texture::ComponentType::SINT:
417 return ComponentType::SInt;
363 default: 418 default:
364 LOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type)); 419 LOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type));
365 UNREACHABLE(); 420 UNREACHABLE();
@@ -374,14 +429,22 @@ struct SurfaceParams {
374 case Tegra::RenderTargetFormat::BGRA8_UNORM: 429 case Tegra::RenderTargetFormat::BGRA8_UNORM:
375 case Tegra::RenderTargetFormat::RGB10_A2_UNORM: 430 case Tegra::RenderTargetFormat::RGB10_A2_UNORM:
376 case Tegra::RenderTargetFormat::R8_UNORM: 431 case Tegra::RenderTargetFormat::R8_UNORM:
432 case Tegra::RenderTargetFormat::RG16_UNORM:
377 return ComponentType::UNorm; 433 return ComponentType::UNorm;
434 case Tegra::RenderTargetFormat::RG16_SNORM:
435 return ComponentType::SNorm;
378 case Tegra::RenderTargetFormat::RGBA16_FLOAT: 436 case Tegra::RenderTargetFormat::RGBA16_FLOAT:
379 case Tegra::RenderTargetFormat::R11G11B10_FLOAT: 437 case Tegra::RenderTargetFormat::R11G11B10_FLOAT:
380 case Tegra::RenderTargetFormat::RGBA32_FLOAT: 438 case Tegra::RenderTargetFormat::RGBA32_FLOAT:
381 case Tegra::RenderTargetFormat::RG32_FLOAT: 439 case Tegra::RenderTargetFormat::RG32_FLOAT:
440 case Tegra::RenderTargetFormat::RG16_FLOAT:
441 case Tegra::RenderTargetFormat::R16_FLOAT:
382 return ComponentType::Float; 442 return ComponentType::Float;
383 case Tegra::RenderTargetFormat::RGBA32_UINT: 443 case Tegra::RenderTargetFormat::RGBA32_UINT:
444 case Tegra::RenderTargetFormat::RG16_UINT:
384 return ComponentType::UInt; 445 return ComponentType::UInt;
446 case Tegra::RenderTargetFormat::RG16_SINT:
447 return ComponentType::SInt;
385 default: 448 default:
386 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); 449 LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
387 UNREACHABLE(); 450 UNREACHABLE();
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp
index 50c5a56f6..d794f8402 100644
--- a/src/video_core/textures/decoders.cpp
+++ b/src/video_core/textures/decoders.cpp
@@ -62,6 +62,7 @@ u32 BytesPerPixel(TextureFormat format) {
62 case TextureFormat::A2B10G10R10: 62 case TextureFormat::A2B10G10R10:
63 case TextureFormat::BF10GF11RF11: 63 case TextureFormat::BF10GF11RF11:
64 case TextureFormat::R32: 64 case TextureFormat::R32:
65 case TextureFormat::R16_G16:
65 return 4; 66 return 4;
66 case TextureFormat::A1B5G5R5: 67 case TextureFormat::A1B5G5R5:
67 case TextureFormat::B5G6R5: 68 case TextureFormat::B5G6R5:
@@ -127,6 +128,7 @@ std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width,
127 case TextureFormat::R32_G32: 128 case TextureFormat::R32_G32:
128 case TextureFormat::R32: 129 case TextureFormat::R32:
129 case TextureFormat::R16: 130 case TextureFormat::R16:
131 case TextureFormat::R16_G16:
130 case TextureFormat::BF10GF11RF11: 132 case TextureFormat::BF10GF11RF11:
131 case TextureFormat::ASTC_2D_4X4: 133 case TextureFormat::ASTC_2D_4X4:
132 CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data, 134 CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data,
@@ -187,6 +189,7 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat
187 case TextureFormat::R32_G32: 189 case TextureFormat::R32_G32:
188 case TextureFormat::R32: 190 case TextureFormat::R32:
189 case TextureFormat::R16: 191 case TextureFormat::R16:
192 case TextureFormat::R16_G16:
190 // TODO(Subv): For the time being just forward the same data without any decoding. 193 // TODO(Subv): For the time being just forward the same data without any decoding.
191 rgba_data = texture_data; 194 rgba_data = texture_data;
192 break; 195 break;
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 3c2726498..97273f967 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -101,6 +101,8 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) {
101 101
102 ConnectMenuEvents(); 102 ConnectMenuEvents();
103 ConnectWidgetEvents(); 103 ConnectWidgetEvents();
104 LOG_INFO(Frontend, "yuzu Version: {} | {}-{}", Common::g_build_name, Common::g_scm_branch,
105 Common::g_scm_desc);
104 106
105 setWindowTitle(QString("yuzu %1| %2-%3") 107 setWindowTitle(QString("yuzu %1| %2-%3")
106 .arg(Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc)); 108 .arg(Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc));
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h
index 5eca38b48..567f23417 100644
--- a/src/yuzu_cmd/default_ini.h
+++ b/src/yuzu_cmd/default_ini.h
@@ -118,7 +118,7 @@ bg_green =
118layout_option = 118layout_option =
119 119
120# Toggle custom layout (using the settings below) on or off. 120# Toggle custom layout (using the settings below) on or off.
121# 0 (default): Off , 1: On 121# 0 (default): Off, 1: On
122custom_layout = 122custom_layout =
123 123
124# Screen placement when using Custom layout option 124# Screen placement when using Custom layout option
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
index 72ba7d49c..e2945b6cf 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
@@ -164,6 +164,8 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) {
164 OnResize(); 164 OnResize();
165 OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size); 165 OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size);
166 SDL_PumpEvents(); 166 SDL_PumpEvents();
167 LOG_INFO(Frontend, "yuzu Version: {} | {}-{}", Common::g_build_name, Common::g_scm_branch,
168 Common::g_scm_desc);
167 169
168 DoneCurrent(); 170 DoneCurrent();
169} 171}