diff --git a/src/mame/namco/namcos22_v.cpp b/src/mame/namco/namcos22_v.cpp index 5c463a1d44f..1173b6681b3 100644 --- a/src/mame/namco/namcos22_v.cpp +++ b/src/mame/namco/namcos22_v.cpp @@ -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]); }