case 0x2D:
case 0x2E:
case 0x2F: { // Textured 4-pt poly
+ u32 dithering = Dithering;
u32 simplified_count;
gpuSetTexture(le32_to_u32(gpu_unai.PacketBuffer.U4[4]) >> 16);
- if ((simplified_count = prim_try_simplify_quad_t(gpu_unai.PacketBuffer.U4,
+ if (!dithering &&
+ (simplified_count = prim_try_simplify_quad_t(gpu_unai.PacketBuffer.U4,
gpu_unai.PacketBuffer.U4)))
{
for (i = 0;; ) {
gpuSetCLUT(le32_to_u32(gpu_unai.PacketBuffer.U4[2]) >> 16);
u32 driver_idx =
- Dithering |
+ dithering |
Blending_Mode | gpu_unai.TEXT_MODE |
gpu_unai.Masking | Blending | gpu_unai.PixelMSB;
case 0x31:
case 0x32:
case 0x33: { // Gouraud-shaded 3-pt poly
+ u32 dithering = Dithering;
//NOTE: The '129' here is CF_GOURAUD | CF_LIGHT, however
// this is an untextured poly, so CF_LIGHT (texture blend)
// shouldn't apply. Until the original array of template
// instantiation ptrs is fixed, we're stuck with this. (TODO)
u8 gouraud = 129;
- u32 xor_ = 0, rgb0 = le32_raw(gpu_unai.PacketBuffer.U4[0]);
- for (i = 1; i < 3; i++)
- xor_ |= rgb0 ^ le32_raw(gpu_unai.PacketBuffer.U4[i * 2]);
- if ((xor_ & HTOLE32(0xf8f8f8)) == 0)
- gouraud = 0;
+ if (!dithering) {
+ u32 xor_ = 0, rgb0 = le32_raw(gpu_unai.PacketBuffer.U4[0]);
+ for (i = 1; i < 3; i++)
+ xor_ |= rgb0 ^ le32_raw(gpu_unai.PacketBuffer.U4[i * 2]);
+ if ((xor_ & HTOLE32(0xf8f8f8)) == 0)
+ gouraud = 0;
+ }
PP driver = gpuPolySpanDrivers[
- Dithering |
+ dithering |
Blending_Mode |
gpu_unai.Masking | Blending | gouraud | gpu_unai.PixelMSB
];
case 0x37: { // Gouraud-shaded, textured 3-pt poly
gpuSetCLUT (le32_to_u32(gpu_unai.PacketBuffer.U4[2]) >> 16);
gpuSetTexture (le32_to_u32(gpu_unai.PacketBuffer.U4[5]) >> 16);
+ u32 dithering = Dithering;
u8 lighting = Lighting;
u8 gouraud = lighting ? (1<<7) : 0;
if (lighting) {
xor_ |= rgb0 ^ le32_raw(gpu_unai.PacketBuffer.U4[i * 3]);
if ((xor_ & HTOLE32(0xf8f8f8)) == 0) {
gouraud = 0;
- if (!need_lighting(rgb0))
+ if (!dithering && !need_lighting(rgb0))
lighting = 0;
}
}
PP driver = gpuPolySpanDrivers[
- Dithering |
+ dithering |
Blending_Mode | gpu_unai.TEXT_MODE |
gpu_unai.Masking | Blending | gouraud | lighting | gpu_unai.PixelMSB
];
case 0x39:
case 0x3A:
case 0x3B: { // Gouraud-shaded 4-pt poly
+ u32 dithering = Dithering;
// See notes regarding '129' for 0x30..0x33 further above -senquack
u8 gouraud = 129;
- u32 xor_ = 0, rgb0 = le32_raw(gpu_unai.PacketBuffer.U4[0]);
- for (i = 1; i < 4; i++)
- xor_ |= rgb0 ^ le32_raw(gpu_unai.PacketBuffer.U4[i * 2]);
- if ((xor_ & HTOLE32(0xf8f8f8)) == 0)
- gouraud = 0;
+ if (!dithering) {
+ u32 xor_ = 0, rgb0 = le32_raw(gpu_unai.PacketBuffer.U4[0]);
+ for (i = 1; i < 4; i++)
+ xor_ |= rgb0 ^ le32_raw(gpu_unai.PacketBuffer.U4[i * 2]);
+ if ((xor_ & HTOLE32(0xf8f8f8)) == 0)
+ gouraud = 0;
+ }
PP driver = gpuPolySpanDrivers[
- Dithering |
+ dithering |
Blending_Mode |
gpu_unai.Masking | Blending | gouraud | gpu_unai.PixelMSB
];
case 0x3D:
case 0x3E:
case 0x3F: { // Gouraud-shaded, textured 4-pt poly
+ u32 dithering = Dithering;
u32 simplified_count;
gpuSetTexture(le32_to_u32(gpu_unai.PacketBuffer.U4[5]) >> 16);
- if ((simplified_count = prim_try_simplify_quad_gt(gpu_unai.PacketBuffer.U4,
+ if (!dithering &&
+ (simplified_count = prim_try_simplify_quad_gt(gpu_unai.PacketBuffer.U4,
gpu_unai.PacketBuffer.U4)))
{
for (i = 0;; ) {
xor_ |= rgb0 ^ le32_raw(gpu_unai.PacketBuffer.U4[i * 3]);
if ((xor_ & HTOLE32(0xf8f8f8)) == 0) {
gouraud = 0;
- if (!need_lighting(rgb0))
+ if (!dithering && !need_lighting(rgb0))
lighting = 0;
}
}
PP driver = gpuPolySpanDrivers[
- Dithering |
+ dithering |
Blending_Mode | gpu_unai.TEXT_MODE |
gpu_unai.Masking | Blending | gouraud | lighting | gpu_unai.PixelMSB
];