mirror of
https://github.com/holub/mame
synced 2025-06-06 12:53:46 +03:00
voodoo_render.cpp: Use util::sext and rotate inline
This commit is contained in:
parent
5bb96d67f8
commit
7b2a7ebdd1
@ -1211,9 +1211,9 @@ void rasterizer_palette::compute_ncc(u32 const *regs)
|
||||
s32 q = regs[8 + BIT(index, 0, 2)];
|
||||
|
||||
// add the coloring
|
||||
s32 r = std::clamp(y + (s32(i << 5) >> 23) + (s32(q << 5) >> 23), 0, 255);
|
||||
s32 g = std::clamp(y + (s32(i << 14) >> 23) + (s32(q << 14) >> 23), 0, 255);
|
||||
s32 b = std::clamp(y + (s32(i << 23) >> 23) + (s32(q << 23) >> 23), 0, 255);
|
||||
s32 r = std::clamp(y + util::sext(i >> 18, 9) + util::sext(q >> 18, 9), 0, 255);
|
||||
s32 g = std::clamp(y + util::sext(i >> 9, 9) + util::sext(q >> 9, 9), 0, 255);
|
||||
s32 b = std::clamp(y + util::sext(i , 9) + util::sext(q , 9), 0, 255);
|
||||
|
||||
// fill in the table
|
||||
m_texel[index] = rgb_t(0xff, r, g, b);
|
||||
@ -1372,7 +1372,7 @@ inline bool ATTR_FORCE_INLINE voodoo_renderer::stipple_test(thread_stats_block &
|
||||
// rotate mode
|
||||
if (fbzmode.stipple_pattern() == 0)
|
||||
{
|
||||
stipple = (stipple >> 1) | (stipple << 31);
|
||||
stipple = rotr_32(stipple, 1);
|
||||
if (s32(stipple) >= 0)
|
||||
{
|
||||
threadstats.stipple_count++;
|
||||
|
Loading…
Reference in New Issue
Block a user