diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 28 | ||||
| -rw-r--r-- | src/core/hle/service/vi/vi_results.h | 13 |
2 files changed, 25 insertions, 16 deletions
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 546879648..0a347a0e9 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -29,16 +29,12 @@ | |||
| 29 | #include "core/hle/service/service.h" | 29 | #include "core/hle/service/service.h" |
| 30 | #include "core/hle/service/vi/vi.h" | 30 | #include "core/hle/service/vi/vi.h" |
| 31 | #include "core/hle/service/vi/vi_m.h" | 31 | #include "core/hle/service/vi/vi_m.h" |
| 32 | #include "core/hle/service/vi/vi_results.h" | ||
| 32 | #include "core/hle/service/vi/vi_s.h" | 33 | #include "core/hle/service/vi/vi_s.h" |
| 33 | #include "core/hle/service/vi/vi_u.h" | 34 | #include "core/hle/service/vi/vi_u.h" |
| 34 | 35 | ||
| 35 | namespace Service::VI { | 36 | namespace Service::VI { |
| 36 | 37 | ||
| 37 | constexpr Result ERR_OPERATION_FAILED{ErrorModule::VI, 1}; | ||
| 38 | constexpr Result ERR_PERMISSION_DENIED{ErrorModule::VI, 5}; | ||
| 39 | constexpr Result ERR_UNSUPPORTED{ErrorModule::VI, 6}; | ||
| 40 | constexpr Result ERR_NOT_FOUND{ErrorModule::VI, 7}; | ||
| 41 | |||
| 42 | struct DisplayInfo { | 38 | struct DisplayInfo { |
| 43 | /// The name of this particular display. | 39 | /// The name of this particular display. |
| 44 | char display_name[0x40]{"Default"}; | 40 | char display_name[0x40]{"Default"}; |
| @@ -348,7 +344,7 @@ private: | |||
| 348 | if (!layer_id) { | 344 | if (!layer_id) { |
| 349 | LOG_ERROR(Service_VI, "Layer not found! display=0x{:016X}", display); | 345 | LOG_ERROR(Service_VI, "Layer not found! display=0x{:016X}", display); |
| 350 | IPC::ResponseBuilder rb{ctx, 2}; | 346 | IPC::ResponseBuilder rb{ctx, 2}; |
| 351 | rb.Push(ERR_NOT_FOUND); | 347 | rb.Push(ResultNotFound); |
| 352 | return; | 348 | return; |
| 353 | } | 349 | } |
| 354 | 350 | ||
| @@ -498,7 +494,7 @@ private: | |||
| 498 | if (!display_id) { | 494 | if (!display_id) { |
| 499 | LOG_ERROR(Service_VI, "Display not found! display_name={}", name); | 495 | LOG_ERROR(Service_VI, "Display not found! display_name={}", name); |
| 500 | IPC::ResponseBuilder rb{ctx, 2}; | 496 | IPC::ResponseBuilder rb{ctx, 2}; |
| 501 | rb.Push(ERR_NOT_FOUND); | 497 | rb.Push(ResultNotFound); |
| 502 | return; | 498 | return; |
| 503 | } | 499 | } |
| 504 | 500 | ||
| @@ -554,14 +550,14 @@ private: | |||
| 554 | 550 | ||
| 555 | if (scaling_mode > NintendoScaleMode::PreserveAspectRatio) { | 551 | if (scaling_mode > NintendoScaleMode::PreserveAspectRatio) { |
| 556 | LOG_ERROR(Service_VI, "Invalid scaling mode provided."); | 552 | LOG_ERROR(Service_VI, "Invalid scaling mode provided."); |
| 557 | rb.Push(ERR_OPERATION_FAILED); | 553 | rb.Push(ResultOperationFailed); |
| 558 | return; | 554 | return; |
| 559 | } | 555 | } |
| 560 | 556 | ||
| 561 | if (scaling_mode != NintendoScaleMode::ScaleToWindow && | 557 | if (scaling_mode != NintendoScaleMode::ScaleToWindow && |
| 562 | scaling_mode != NintendoScaleMode::PreserveAspectRatio) { | 558 | scaling_mode != NintendoScaleMode::PreserveAspectRatio) { |
| 563 | LOG_ERROR(Service_VI, "Unsupported scaling mode supplied."); | 559 | LOG_ERROR(Service_VI, "Unsupported scaling mode supplied."); |
| 564 | rb.Push(ERR_UNSUPPORTED); | 560 | rb.Push(ResultNotSupported); |
| 565 | return; | 561 | return; |
| 566 | } | 562 | } |
| 567 | 563 | ||
| @@ -594,7 +590,7 @@ private: | |||
| 594 | if (!display_id) { | 590 | if (!display_id) { |
| 595 | LOG_ERROR(Service_VI, "Layer not found! layer_id={}", layer_id); | 591 | LOG_ERROR(Service_VI, "Layer not found! layer_id={}", layer_id); |
| 596 | IPC::ResponseBuilder rb{ctx, 2}; | 592 | IPC::ResponseBuilder rb{ctx, 2}; |
| 597 | rb.Push(ERR_NOT_FOUND); | 593 | rb.Push(ResultNotFound); |
| 598 | return; | 594 | return; |
| 599 | } | 595 | } |
| 600 | 596 | ||
| @@ -602,7 +598,7 @@ private: | |||
| 602 | if (!buffer_queue_id) { | 598 | if (!buffer_queue_id) { |
| 603 | LOG_ERROR(Service_VI, "Buffer queue id not found! display_id={}", *display_id); | 599 | LOG_ERROR(Service_VI, "Buffer queue id not found! display_id={}", *display_id); |
| 604 | IPC::ResponseBuilder rb{ctx, 2}; | 600 | IPC::ResponseBuilder rb{ctx, 2}; |
| 605 | rb.Push(ERR_NOT_FOUND); | 601 | rb.Push(ResultNotFound); |
| 606 | return; | 602 | return; |
| 607 | } | 603 | } |
| 608 | 604 | ||
| @@ -640,7 +636,7 @@ private: | |||
| 640 | if (!layer_id) { | 636 | if (!layer_id) { |
| 641 | LOG_ERROR(Service_VI, "Layer not found! display_id={}", display_id); | 637 | LOG_ERROR(Service_VI, "Layer not found! display_id={}", display_id); |
| 642 | IPC::ResponseBuilder rb{ctx, 2}; | 638 | IPC::ResponseBuilder rb{ctx, 2}; |
| 643 | rb.Push(ERR_NOT_FOUND); | 639 | rb.Push(ResultNotFound); |
| 644 | return; | 640 | return; |
| 645 | } | 641 | } |
| 646 | 642 | ||
| @@ -648,7 +644,7 @@ private: | |||
| 648 | if (!buffer_queue_id) { | 644 | if (!buffer_queue_id) { |
| 649 | LOG_ERROR(Service_VI, "Buffer queue id not found! display_id={}", display_id); | 645 | LOG_ERROR(Service_VI, "Buffer queue id not found! display_id={}", display_id); |
| 650 | IPC::ResponseBuilder rb{ctx, 2}; | 646 | IPC::ResponseBuilder rb{ctx, 2}; |
| 651 | rb.Push(ERR_NOT_FOUND); | 647 | rb.Push(ResultNotFound); |
| 652 | return; | 648 | return; |
| 653 | } | 649 | } |
| 654 | 650 | ||
| @@ -681,7 +677,7 @@ private: | |||
| 681 | if (!vsync_event) { | 677 | if (!vsync_event) { |
| 682 | LOG_ERROR(Service_VI, "Vsync event was not found for display_id={}", display_id); | 678 | LOG_ERROR(Service_VI, "Vsync event was not found for display_id={}", display_id); |
| 683 | IPC::ResponseBuilder rb{ctx, 2}; | 679 | IPC::ResponseBuilder rb{ctx, 2}; |
| 684 | rb.Push(ERR_NOT_FOUND); | 680 | rb.Push(ResultNotFound); |
| 685 | return; | 681 | return; |
| 686 | } | 682 | } |
| 687 | 683 | ||
| @@ -764,7 +760,7 @@ private: | |||
| 764 | return ConvertedScaleMode::PreserveAspectRatio; | 760 | return ConvertedScaleMode::PreserveAspectRatio; |
| 765 | default: | 761 | default: |
| 766 | LOG_ERROR(Service_VI, "Invalid scaling mode specified, mode={}", mode); | 762 | LOG_ERROR(Service_VI, "Invalid scaling mode specified, mode={}", mode); |
| 767 | return ERR_OPERATION_FAILED; | 763 | return ResultOperationFailed; |
| 768 | } | 764 | } |
| 769 | } | 765 | } |
| 770 | 766 | ||
| @@ -794,7 +790,7 @@ void detail::GetDisplayServiceImpl(Kernel::HLERequestContext& ctx, Core::System& | |||
| 794 | if (!IsValidServiceAccess(permission, policy)) { | 790 | if (!IsValidServiceAccess(permission, policy)) { |
| 795 | LOG_ERROR(Service_VI, "Permission denied for policy {}", policy); | 791 | LOG_ERROR(Service_VI, "Permission denied for policy {}", policy); |
| 796 | IPC::ResponseBuilder rb{ctx, 2}; | 792 | IPC::ResponseBuilder rb{ctx, 2}; |
| 797 | rb.Push(ERR_PERMISSION_DENIED); | 793 | rb.Push(ResultPermissionDenied); |
| 798 | return; | 794 | return; |
| 799 | } | 795 | } |
| 800 | 796 | ||
diff --git a/src/core/hle/service/vi/vi_results.h b/src/core/hle/service/vi/vi_results.h new file mode 100644 index 000000000..a46c247d2 --- /dev/null +++ b/src/core/hle/service/vi/vi_results.h | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "core/hle/result.h" | ||
| 5 | |||
| 6 | namespace Service::VI { | ||
| 7 | |||
| 8 | constexpr Result ResultOperationFailed{ErrorModule::VI, 1}; | ||
| 9 | constexpr Result ResultPermissionDenied{ErrorModule::VI, 5}; | ||
| 10 | constexpr Result ResultNotSupported{ErrorModule::VI, 6}; | ||
| 11 | constexpr Result ResultNotFound{ErrorModule::VI, 7}; | ||
| 12 | |||
| 13 | } // namespace Service::VI | ||