mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Refactor OpcodeDecoding and FIFO analyzer to use callbacks
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "Common/BitField.h"
|
||||
@ -630,13 +631,21 @@ class VertexLoaderBase;
|
||||
// STATE_TO_SAVE
|
||||
struct CPState final
|
||||
{
|
||||
CPState() = default;
|
||||
explicit CPState(const u32* memory);
|
||||
|
||||
// Mutates the CP state based on the given command and value.
|
||||
void LoadCPReg(u8 sub_cmd, u32 value);
|
||||
// Fills memory with data from CP regs. There should be space for 0x100 values in memory.
|
||||
void FillCPMemoryArray(u32* memory) const;
|
||||
|
||||
Common::EnumMap<u32, CPArray::XF_D> array_bases;
|
||||
Common::EnumMap<u32, CPArray::XF_D> array_strides;
|
||||
TMatrixIndexA matrix_index_a{};
|
||||
TMatrixIndexB matrix_index_b{};
|
||||
TVtxDesc vtx_desc;
|
||||
// Most games only use the first VtxAttr and simply reconfigure it all the time as needed.
|
||||
VAT vtx_attr[CP_NUM_VAT_REG]{};
|
||||
std::array<VAT, CP_NUM_VAT_REG> vtx_attr{};
|
||||
|
||||
// Attributes that actually belong to VertexLoaderManager:
|
||||
BitSet32 attr_dirty{};
|
||||
@ -644,18 +653,13 @@ struct CPState final
|
||||
VertexLoaderBase* vertex_loaders[CP_NUM_VAT_REG]{};
|
||||
int last_id = 0;
|
||||
};
|
||||
static_assert(std::is_trivially_copyable_v<CPState>);
|
||||
|
||||
class PointerWrap;
|
||||
|
||||
extern CPState g_main_cp_state;
|
||||
extern CPState g_preprocess_cp_state;
|
||||
|
||||
// Might move this into its own file later.
|
||||
void LoadCPReg(u32 SubCmd, u32 Value, bool is_preprocess = false);
|
||||
|
||||
// Fills memory with data from CP regs
|
||||
void FillCPMemoryArray(u32* memory);
|
||||
|
||||
void DoCPState(PointerWrap& p);
|
||||
|
||||
void CopyPreprocessCPStateFromMain();
|
||||
|
Reference in New Issue
Block a user