Convert BPMemory to BitField and enum class

Additional changes:
- For TevStageCombiner's ColorCombiner and AlphaCombiner, op/comparison and scale/compare_mode have been split as there are different meanings and enums if bias is set to compare.  (Shift has also been renamed to scale)
- In TexMode0, min_filter has been split into min_mip and min_filter.
- In TexImage1, image_type is now cache_manually_managed.
- The unused bit in GenMode is now exposed.
- LPSize's lineaspect is now named adjust_for_aspect_ratio.
This commit is contained in:
Pokechu22
2021-02-10 18:11:31 -08:00
parent db8ced7e4e
commit 70f9fc4e75
33 changed files with 1553 additions and 1236 deletions

View File

@ -6,6 +6,7 @@
#include <tuple>
#include "Common/CommonTypes.h"
#include "Common/EnumFormatter.h"
enum
{
@ -32,8 +33,17 @@ enum class TextureFormat
// Special texture format used to represent YUVY xfb copies.
// They aren't really textures, but they share so much hardware and usecases that it makes sense
// to emulate them as part of texture cache.
// This isn't a real value that can be used on console; it only exists for ease of implementation.
XFB = 0xF,
};
template <>
struct fmt::formatter<TextureFormat> : EnumFormatter<TextureFormat::CMPR>
{
static constexpr array_type names = {"I4", "I8", "IA4", "IA8", "RGB565",
"RGB5A3", "RGBA8", nullptr, "C4", "C8",
"C14X2", nullptr, nullptr, nullptr, "CMPR"};
formatter() : EnumFormatter(names) {}
};
static inline bool IsColorIndexed(TextureFormat format)
{
@ -82,8 +92,20 @@ enum class EFBCopyFormat
// Special texture format used to represent YUVY xfb copies.
// They aren't really textures, but they share so much hardware and usecases that it makes sense
// to emulate them as part of texture cache.
// This isn't a real value that can be used on console; it only exists for ease of implementation.
XFB = 0xF,
};
template <>
struct fmt::formatter<EFBCopyFormat> : EnumFormatter<EFBCopyFormat::GB8>
{
static constexpr array_type names = {
"R4/I4/Z4", "R8/I8/Z8H (?)", "RA4/IA4", "RA8/IA8 (Z16 too?)",
"RGB565", "RGB5A3", "RGBA8", "A8",
"R8/I8/Z8H", "G8/Z8M", "B8/Z8L", "RG8/Z16R (Note: G and R are reversed)",
"GB8/Z16L",
};
formatter() : EnumFormatter(names) {}
};
enum class TLUTFormat
{
@ -92,6 +114,11 @@ enum class TLUTFormat
RGB565 = 0x1,
RGB5A3 = 0x2,
};
template <>
struct fmt::formatter<TLUTFormat> : EnumFormatter<TLUTFormat::RGB5A3>
{
formatter() : EnumFormatter({"IA8", "RGB565", "RGB5A3"}) {}
};
static inline bool IsValidTLUTFormat(TLUTFormat tlutfmt)
{