Mechanical changes to move most CP state to a struct rather than separate globals.

The next commit will add a separate copy of the struct and the ability
for LoadCPReg to work on it.
This commit is contained in:
comex
2014-08-27 13:26:06 -04:00
parent 90638c6806
commit f0131c2e09
16 changed files with 146 additions and 148 deletions

View File

@ -231,12 +231,6 @@ union TMatrixIndexB
#pragma pack()
extern u32 arraybases[16];
extern u8 *cached_arraybases[16];
extern u32 arraystrides[16];
extern TMatrixIndexA MatrixIndexA;
extern TMatrixIndexB MatrixIndexB;
struct VAT
{
UVAT_group0 g0;
@ -244,8 +238,25 @@ struct VAT
UVAT_group2 g2;
};
extern TVtxDesc g_VtxDesc;
extern VAT g_VtxAttr[8];
// STATE_TO_SAVE
struct CPState final
{
u32 array_bases[16];
u32 array_strides[16];
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[8];
};
class PointerWrap;
extern void DoCPState(PointerWrap& p);
extern CPState g_main_cp_state;
extern u8 *cached_arraybases[16];
// Might move this into its own file later.
void LoadCPReg(u32 SubCmd, u32 Value);