Skip to content
Permalink
Browse files

gpu: copy bits from textured polygon commands to e1

Fixes Tekken 3 Health bar and Worms Armageddon menu and player names
  • Loading branch information
JaCzekanski committed Dec 3, 2019
1 parent c7d1d21 commit f50c5821243fcaa0ee094a5ca206c350e721cea3
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/device/gpu/gpu.cpp
@@ -288,6 +288,18 @@ void GPU::cmdPolygon(PolygonArgs arg) {
triangle.clut.x = tex.getClutX();
triangle.clut.y = tex.getClutY();
triangle.transparency = tex.semiTransparencyBlending();

// Copy texture bits from Polygon draw command to E1 register
// texpagex, texpagey, semi-transparency, texture disable bits
const uint32_t E1_MASK = 0b00001001'11111111;

uint16_t newBits = (tex.texpage >> 16) & E1_MASK;
if (!textureDisableAllowed) {
newBits &= ~(1 << 11);
}

gp0_e1._reg &= ~E1_MASK;
gp0_e1._reg |= newBits;
}

triangle.assureCcw();
@@ -617,6 +629,9 @@ void GPU::writeGP0(uint32_t data) {
} else if (command == 0xe1) {
// Draw mode setting
gp0_e1._reg = arguments[0];
if (!textureDisableAllowed) {
gp0_e1.textureDisable = false;
}
} else if (command == 0xe2) {
// Texture window setting
gp0_e2._reg = arguments[0];

0 comments on commit f50c582

Please sign in to comment.
You can’t perform that action at this time.