namcos22: possible overflow on texture bank (shouldnt happen)

This commit is contained in:
hap 2022-11-26 15:51:45 +01:00
parent 646bcfc81e
commit 694c21c47f

View File

@ -81,9 +81,9 @@ void namcos22_renderer::renderscanline_poly(int32_t scanline, const extent_t &ex
// texture mapping
if (texture_enabled)
{
int tx = u * ooz;
int ty = v * ooz + bn;
int to = ((ty & 0xfff0) << 4) | ((tx & 0xff0) >> 4);
int tx = int(u * ooz) & 0xfff;
int ty = (int(v * ooz) & 0xfff) | bn;
int to = (ty << 4 & 0xfff00) | (tx >> 4);
pen = ttdata[(ttmap[to] << 8) | tt_ayx_to_pixel[ttattr[to] << 8 | (ty << 4 & 0xf0) | (tx & 0xf)]];
rgb.set(pens[pen >> penshift & penmask]);
}
@ -174,9 +174,9 @@ void namcos22_renderer::renderscanline_poly_ss22(int32_t scanline, const extent_
// texture mapping
if (texture_enabled)
{
int tx = u * ooz;
int ty = v * ooz + bn;
int to = ((ty & 0xfff0) << 4) | ((tx & 0xff0) >> 4);
int tx = int(u * ooz) & 0xfff;
int ty = (int(v * ooz) & 0xfff) | bn;
int to = (ty << 4 & 0xfff00) | (tx >> 4);
pen = ttdata[(ttmap[to] << 8) | tt_ayx_to_pixel[ttattr[to] << 8 | (ty << 4 & 0xf0) | (tx & 0xf)]];
rgb.set(pens[pen >> penshift & penmask]);
}