dffclient: Add support for modifying the PE_CONTROL register.

This commit is contained in:
Tony Wasserka
2014-02-01 19:42:31 +01:00
parent 7badc8ff2d
commit baa40a4af0
3 changed files with 15 additions and 10 deletions

View File

@@ -227,6 +227,15 @@ void LayoutStream::ActiveItemChanged(const QModelIndex& index)
AddCheckBox(mode.alphaupdate, tr("Enable alpha writing")).endl();
AddCheckBox(mode.dither, tr("Enable dithering")).endl();
}
else if (fifo_data[cmd_start+1] == BPMEM_ZCOMPARE) // 0x43
{
GET(PE_CONTROL, ctrl);
AddLabel(tr("Pixel Engine control")).endl();
AddLabel(tr("EFB pixel format: ")).AddComboBox(ctrl.pixel_format, {"RGB8 Z24", "RGBA6 Z24", "RGB565 Z16", "Z24", "Y8", "U8", "V8", "YUV420"}).endl();
AddLabel(tr("EFB depth format: ")).AddComboBox(ctrl.zformat, {tr("Linear"), tr("Near"), tr("Mid"), tr("Far"), tr("Inverse near"), tr("Inverse mid"), tr("Inverse far")}).endl();
AddCheckBox(ctrl.early_ztest, tr("Early depth test")).endl();
}
else if (fifo_data[cmd_start+1] == BPMEM_TRIGGER_EFB_COPY) // 0x52
{
UPE_Copy& copy = *(UPE_Copy*)&cmddata;

View File

@@ -116,7 +116,7 @@ void GetBPRegInfo(const u8* data, char* name, size_t name_size, char* desc, size
case BPMEM_ZCOMPARE: // 0x43
{
SetRegName(BPMEM_ZCOMPARE);
PE_CONTROL config; config.hex = cmddata;
PE_CONTROL& config = *(PE_CONTROL*)&cmddata;
const char* pixel_formats[] = { "RGB8_Z24", "RGBA6_Z24", "RGB565_Z16", "Z24", "Y8", "U8", "V8", "YUV420" };
const char* zformats[] = { "linear", "compressed (near)", "compressed (mid)", "compressed (far)", "inv linear", "compressed (inv near)", "compressed (inv mid)", "compressed (inv far)" };
snprintf(desc, desc_size, "EFB pixel format: %s\n"

View File

@@ -765,14 +765,10 @@ union FieldMask
union PE_CONTROL
{
struct
{
u32 pixel_format : 3; // PIXELFMT_X
u32 zformat : 3; // Z Compression for 16bit Z format
u32 early_ztest : 1; // 1: before tex stage
u32 unused : 17;
u32 rid : 8;
};
BitField<0,3> pixel_format; // PIXELFMT_X
BitField<3,3> zformat; // Z compression for 16 bit Z format
BitField<6,1> early_ztest; // 1: before tex stage
u32 hex;
};