y2r_u.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "common/logging/log.h"
  5. #include "core/hle/hle.h"
  6. #include "core/hle/kernel/event.h"
  7. #include "core/hle/service/y2r_u.h"
  8. ////////////////////////////////////////////////////////////////////////////////////////////////////
  9. // Namespace Y2R_U
  10. namespace Y2R_U {
  11. static Kernel::SharedPtr<Kernel::Event> completion_event;
  12. /**
  13. * Y2R_U::IsBusyConversion service function
  14. * Outputs:
  15. * 1 : Result of function, 0 on success, otherwise error code
  16. * 2 : Whether the current conversion is of type busy conversion (?)
  17. */
  18. static void IsBusyConversion(Service::Interface* self) {
  19. u32* cmd_buff = Kernel::GetCommandBuffer();
  20. cmd_buff[1] = RESULT_SUCCESS.raw;;
  21. cmd_buff[2] = 0;
  22. LOG_WARNING(Service, "(STUBBED) called");
  23. }
  24. /**
  25. * Y2R_U::GetTransferEndEvent service function
  26. * Outputs:
  27. * 1 : Result of function, 0 on success, otherwise error code
  28. * 3 : The handle of the completion event
  29. */
  30. static void GetTransferEndEvent(Service::Interface* self) {
  31. u32* cmd_buff = Kernel::GetCommandBuffer();
  32. cmd_buff[1] = RESULT_SUCCESS.raw;
  33. cmd_buff[3] = Kernel::g_handle_table.Create(completion_event).MoveFrom();
  34. }
  35. const Interface::FunctionInfo FunctionTable[] = {
  36. {0x00010040, nullptr, "SetInputFormat"},
  37. {0x00030040, nullptr, "SetOutputFormat"},
  38. {0x00050040, nullptr, "SetRotation"},
  39. {0x00070040, nullptr, "SetBlockAlignment"},
  40. {0x000D0040, nullptr, "SetTransferEndInterrupt"},
  41. {0x000F0000, GetTransferEndEvent, "GetTransferEndEvent"},
  42. {0x00100102, nullptr, "SetSendingY"},
  43. {0x00110102, nullptr, "SetSendingU"},
  44. {0x00120102, nullptr, "SetSendingV"},
  45. {0x00180102, nullptr, "SetReceiving"},
  46. {0x001A0040, nullptr, "SetInputLineWidth"},
  47. {0x001C0040, nullptr, "SetInputLines"},
  48. {0x00200040, nullptr, "SetStandardCoefficient"},
  49. {0x00220040, nullptr, "SetAlpha"},
  50. {0x00260000, nullptr, "StartConversion"},
  51. {0x00270000, nullptr, "StopConversion"},
  52. {0x00280000, IsBusyConversion, "IsBusyConversion"},
  53. {0x002A0000, nullptr, "PingProcess"},
  54. {0x002B0000, nullptr, "DriverInitialize"},
  55. {0x002C0000, nullptr, "DriverFinalize"}
  56. };
  57. ////////////////////////////////////////////////////////////////////////////////////////////////////
  58. // Interface class
  59. Interface::Interface() {
  60. completion_event = Kernel::Event::Create(RESETTYPE_ONESHOT, "Y2R:Completed");
  61. Register(FunctionTable);
  62. }
  63. } // namespace