y2r_u.cpp 2.8 KB

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