mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
-newport: Various fixes. [Ryan Holtz]
* Fixed double-buffered source value shifts; fixes flickering in buttonfly. * Fixed swapped X/Y in bresenham line drawing; fixes misplaced graphics in buttonfly.
This commit is contained in:
parent
d2d78c93d7
commit
e6faf47b1e
@ -1382,8 +1382,11 @@ bool newport_video_device::pixel_clip_pass(int16_t x, int16_t y)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void newport_video_device::store_pixel(uint8_t *dest_buf, const uint8_t src)
|
void newport_video_device::store_pixel(uint8_t *dest_buf, uint8_t src)
|
||||||
{
|
{
|
||||||
|
if (BIT(m_rex3.m_draw_mode1, 5))
|
||||||
|
src <<= 4;
|
||||||
|
|
||||||
const uint8_t dst = *dest_buf;
|
const uint8_t dst = *dest_buf;
|
||||||
*dest_buf &= ~m_rex3.m_write_mask;
|
*dest_buf &= ~m_rex3.m_write_mask;
|
||||||
|
|
||||||
@ -1558,9 +1561,9 @@ void newport_video_device::do_iline(uint8_t color, bool skip_last, bool shade)
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (shade)
|
if (shade)
|
||||||
write_pixel(x1, y1, (uint8_t)(m_rex3.m_color_red >> 11));
|
write_pixel(y1, x1, (uint8_t)(m_rex3.m_color_red >> 11));
|
||||||
else
|
else
|
||||||
write_pixel(x1, y1, color);
|
write_pixel(y1, x1, color);
|
||||||
|
|
||||||
if (e > 0)
|
if (e > 0)
|
||||||
{
|
{
|
||||||
@ -1576,6 +1579,14 @@ void newport_video_device::do_iline(uint8_t color, bool skip_last, bool shade)
|
|||||||
if (shade)
|
if (shade)
|
||||||
m_rex3.m_color_red += m_rex3.m_slope_red;
|
m_rex3.m_color_red += m_rex3.m_slope_red;
|
||||||
} while (x1 != x2);
|
} while (x1 != x2);
|
||||||
|
|
||||||
|
if (!skip_last)
|
||||||
|
{
|
||||||
|
if (shade)
|
||||||
|
write_pixel(y1, x1, (uint8_t)(m_rex3.m_color_red >> 11));
|
||||||
|
else
|
||||||
|
write_pixel(y1, x1, color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1600,15 +1611,15 @@ void newport_video_device::do_iline(uint8_t color, bool skip_last, bool shade)
|
|||||||
if (shade)
|
if (shade)
|
||||||
m_rex3.m_color_red += m_rex3.m_slope_red;
|
m_rex3.m_color_red += m_rex3.m_slope_red;
|
||||||
} while (x1 != x2);
|
} while (x1 != x2);
|
||||||
}
|
|
||||||
|
|
||||||
if (!skip_last)
|
if (!skip_last)
|
||||||
{
|
{
|
||||||
if (shade)
|
if (shade)
|
||||||
write_pixel(x1, y1, (uint8_t)(m_rex3.m_color_red >> 11));
|
write_pixel(x1, y1, (uint8_t)(m_rex3.m_color_red >> 11));
|
||||||
else
|
else
|
||||||
write_pixel(x1, y1, color);
|
write_pixel(x1, y1, color);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
write_x_start(x1 << 11);
|
write_x_start(x1 << 11);
|
||||||
write_y_start(y1 << 11);
|
write_y_start(y1 << 11);
|
||||||
|
@ -189,7 +189,7 @@ private:
|
|||||||
bool pixel_clip_pass(int16_t x, int16_t y);
|
bool pixel_clip_pass(int16_t x, int16_t y);
|
||||||
void write_pixel(uint8_t color, bool shade);
|
void write_pixel(uint8_t color, bool shade);
|
||||||
void write_pixel(int16_t x, int16_t y, uint8_t color);
|
void write_pixel(int16_t x, int16_t y, uint8_t color);
|
||||||
void store_pixel(uint8_t *dest_buf, const uint8_t src);
|
void store_pixel(uint8_t *dest_buf, uint8_t src);
|
||||||
|
|
||||||
void do_v_iline(uint8_t color, bool skip_last, bool shade);
|
void do_v_iline(uint8_t color, bool skip_last, bool shade);
|
||||||
void do_h_iline(uint8_t color, bool skip_last, bool shade);
|
void do_h_iline(uint8_t color, bool skip_last, bool shade);
|
||||||
|
Loading…
Reference in New Issue
Block a user