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