diff --git a/GPU/Common/DepalettizeShaderCommon.cpp b/GPU/Common/DepalettizeShaderCommon.cpp index e95691cc8e..d435d6ca28 100644 --- a/GPU/Common/DepalettizeShaderCommon.cpp +++ b/GPU/Common/DepalettizeShaderCommon.cpp @@ -80,10 +80,20 @@ void GenerateDepalShader300(char *buffer, GEBufferFormat pixelFormat, ShaderLang int shift = gstate.getClutIndexShift(); int offset = gstate.getClutIndexStartPos(); GEPaletteFormat clutFormat = gstate.getClutPaletteFormat(); - // Unfortunately sampling turned our texture into floating point. To avoid this, might be able + + // Sampling turns our texture into floating point. To avoid this, might be able // to declare them as isampler2D objects, but these require integer textures, which needs more work. - // Anyhow, we simply work around this by converting back to integer. Hopefully there will be no loss of precision. + // Anyhow, we simply work around this by converting back to integer, which is fine. // Use the mask to skip reading some components. + + // TODO: Since we actually have higher precision color data here, we might want to apply a dithering pattern here + // in the 5551, 565 and 4444 modes. This would benefit Test Drive which renders at 16-bit on the real hardware + // and dithers immediately, while we render at higher color depth and thus don't dither resulting in banding + // when we sample it at low color depth like this. + + // An alternative would be to have a special mode where we keep some extra precision here and sample the CLUT linearly - works for ramps such + // as those that Test Drive uses for its color remapping. But would need game specific flagging. + int shiftedMask = mask << shift; switch (pixelFormat) { case GE_FORMAT_8888: diff --git a/assets/compat.ini b/assets/compat.ini index 7826197a67..b07222ea85 100644 --- a/assets/compat.ini +++ b/assets/compat.ini @@ -538,6 +538,12 @@ ULJM05049 = true ULKS46027 = true ULAS42019 = true +# Test Drive Unlimited +ULET00386 = true +ULUS10249 = true +ULES00637 = true +ULKS46126 = true + # Note! This whole flag is disabled temporarily by appending "Disabled" to its name). See 7914 [YugiohSaveFixDisabled] # The cause of Yu-gi-oh series 's bad save (cannot save) are load "save status" and use cwcheat,