Voodoo non-recompiler now uses correct W coordinate for TMU #1
This commit is contained in:
parent
fd8b80d371
commit
de1d72b92b
1 changed files with 8 additions and 6 deletions
|
|
@ -1843,18 +1843,20 @@ static inline void voodoo_tmu_fetch(voodoo_t *voodoo, voodoo_params_t *params, v
|
||||||
if (params->textureMode[tmu] & 1)
|
if (params->textureMode[tmu] & 1)
|
||||||
{
|
{
|
||||||
int64_t _w = 0;
|
int64_t _w = 0;
|
||||||
if (state->tmu1_w)
|
|
||||||
_w = (int64_t)((1ULL << 48) / state->tmu1_w);
|
|
||||||
|
|
||||||
if (tmu)
|
if (tmu)
|
||||||
{
|
{
|
||||||
state->tex_s = (int32_t)(((state->tmu1_s >> 14) * _w) >> 30);
|
if (state->tmu1_w)
|
||||||
state->tex_t = (int32_t)(((state->tmu1_t >> 14) * _w) >> 30);
|
_w = (int64_t)((1ULL << 48) / state->tmu1_w);
|
||||||
|
state->tex_s = (int32_t)(((((state->tmu1_s + (1 << 13)) >> 14) * _w) + (1 << 29)) >> 30);
|
||||||
|
state->tex_t = (int32_t)(((((state->tmu1_t + (1 << 13)) >> 14) * _w) + (1 << 29)) >> 30);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
state->tex_s = (int32_t)(((state->tmu0_s >> 14) * _w) >> 30);
|
if (state->tmu0_w)
|
||||||
state->tex_t = (int32_t)(((state->tmu0_t >> 14) * _w) >> 30);
|
_w = (int64_t)((1ULL << 48) / state->tmu0_w);
|
||||||
|
state->tex_s = (int32_t)(((((state->tmu0_s + (1 << 13)) >> 14) * _w) + (1 << 29)) >> 30);
|
||||||
|
state->tex_t = (int32_t)(((((state->tmu0_t + (1 << 13)) >> 14) * _w) + (1 << 29)) >> 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
state->lod = state->tmu[tmu].lod + (fastlog(_w) - (19 << 8));
|
state->lod = state->tmu[tmu].lod + (fastlog(_w) - (19 << 8));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue