behavior_info.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright 2020 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <array>
  6. #include <vector>
  7. #include "common/common_funcs.h"
  8. #include "common/common_types.h"
  9. #include "common/swap.h"
  10. namespace AudioCore {
  11. class BehaviorInfo {
  12. public:
  13. explicit BehaviorInfo();
  14. ~BehaviorInfo();
  15. bool UpdateInput(const std::vector<u8>& buffer, std::size_t offset);
  16. bool UpdateOutput(std::vector<u8>& buffer, std::size_t offset);
  17. void ClearError();
  18. void UpdateFlags(u64_le dest_flags);
  19. void SetUserRevision(u32_le revision);
  20. bool IsAdpcmLoopContextBugFixed() const;
  21. bool IsSplitterSupported() const;
  22. bool IsLongSizePreDelaySupported() const;
  23. bool IsAudioRenererProcessingTimeLimit80PercentSupported() const;
  24. bool IsAudioRenererProcessingTimeLimit75PercentSupported() const;
  25. bool IsAudioRenererProcessingTimeLimit70PercentSupported() const;
  26. bool IsElapsedFrameCountSupported() const;
  27. bool IsMemoryPoolForceMappingEnabled() const;
  28. private:
  29. u32_le process_revision{};
  30. u32_le user_revision{};
  31. u64_le flags{};
  32. struct ErrorInfo {
  33. u32_le result{};
  34. INSERT_PADDING_WORDS(1);
  35. u64_le result_info{};
  36. };
  37. static_assert(sizeof(ErrorInfo) == 0x10, "ErrorInfo is an invalid size");
  38. std::array<ErrorInfo, 10> errors{};
  39. std::size_t error_count{};
  40. struct InParams {
  41. u32_le revision{};
  42. u32_le padding{};
  43. u64_le flags{};
  44. };
  45. static_assert(sizeof(InParams) == 0x10, "InParams is an invalid size");
  46. struct OutParams {
  47. std::array<ErrorInfo, 10> errors{};
  48. u32_le error_count{};
  49. INSERT_PADDING_BYTES(12);
  50. };
  51. static_assert(sizeof(OutParams) == 0xb0, "OutParams is an invalid size");
  52. };
  53. } // namespace AudioCore