SvcHandler.cs 889 B

12345678910111213141516171819202122232425262728293031323334
  1. using ARMeilleure.State;
  2. using Ryujinx.HLE.HOS.Kernel.Process;
  3. using System;
  4. namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
  5. {
  6. partial class SvcHandler
  7. {
  8. private Switch _device;
  9. private KProcess _process;
  10. private Horizon _system;
  11. public SvcHandler(Switch device, KProcess process)
  12. {
  13. _device = device;
  14. _process = process;
  15. _system = device.System;
  16. }
  17. public void SvcCall(object sender, InstExceptionEventArgs e)
  18. {
  19. Action<SvcHandler, IExecutionContext> svcFunc = SvcTable.GetSvcFunc(e.Id);
  20. if (svcFunc == null)
  21. {
  22. throw new NotImplementedException($"SVC 0x{e.Id:X4} is not implemented.");
  23. }
  24. IExecutionContext context = (IExecutionContext)sender;
  25. svcFunc(this, context);
  26. }
  27. }
  28. }