command_processor.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/bit_field.h"
  6. #include "common/common_types.h"
  7. #include "pica.h"
  8. namespace Pica {
  9. namespace CommandProcessor {
  10. union CommandHeader {
  11. u32 hex;
  12. BitField< 0, 16, u32> cmd_id;
  13. // parameter_mask:
  14. // Mask applied to the input value to make it possible to update
  15. // parts of a register without overwriting its other fields.
  16. // first bit: 0x000000FF
  17. // second bit: 0x0000FF00
  18. // third bit: 0x00FF0000
  19. // fourth bit: 0xFF000000
  20. BitField<16, 4, u32> parameter_mask;
  21. BitField<20, 11, u32> extra_data_length;
  22. BitField<31, 1, u32> group_commands;
  23. };
  24. static_assert(std::is_standard_layout<CommandHeader>::value == true,
  25. "CommandHeader does not use standard layout");
  26. static_assert(sizeof(CommandHeader) == sizeof(u32), "CommandHeader has incorrect size!");
  27. void ProcessCommandList(const u32* list, u32 size);
  28. } // namespace
  29. } // namespace