Convert CPMemory to BitField and enum class

Additionally, VCacheEnhance has been added to UVAT_group1.  According to YAGCD, this field is always 1.

TVtxDesc also now has separate low and high fields whose hex values correspond with the proper registers, instead of having one 33-bit value.  This change was made in a way that should be backwards-compatible.
This commit is contained in:
Pokechu22
2021-02-08 15:22:10 -08:00
parent c27efb3f1f
commit f749fcfa9f
21 changed files with 705 additions and 603 deletions

View File

@ -618,9 +618,9 @@ void VertexShaderManager::SetVertexFormat(u32 components)
// The default alpha channel seems to depend on the number of components in the vertex format.
// If the vertex attribute has an alpha channel, zero is used, otherwise one.
const u32 color_chan_alpha =
(g_main_cp_state.vtx_attr[g_main_cp_state.last_id].g0.Color0Elements ^ 1) |
((g_main_cp_state.vtx_attr[g_main_cp_state.last_id].g0.Color1Elements ^ 1) << 1);
const auto g0 = g_main_cp_state.vtx_attr[g_main_cp_state.last_id].g0;
const u32 color_chan_alpha = (g0.Color0Elements == ColorComponentCount::RGB ? 1 : 0) |
(g0.Color1Elements == ColorComponentCount::RGB ? 2 : 0);
if (color_chan_alpha != constants.color_chan_alpha)
{
constants.color_chan_alpha = color_chan_alpha;