summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2019-02-23 23:56:54 +0100
committer MooglyGuy <therealmogminer@gmail.com>2019-02-23 23:58:02 +0100
commite6faf47b1ef5e5c137f1a68c57d7b854be820012 (patch)
tree9aadadc2230499898f797f8d55c028602a609ac2
parentd2d78c93d73a89b9478b22192c424e1ab42ae7f1 (diff)
-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.
-rw-r--r--src/mame/video/newport.cpp33
-rw-r--r--src/mame/video/newport.h2
2 files changed, 23 insertions, 12 deletions
diff --git a/src/mame/video/newport.cpp b/src/mame/video/newport.cpp
index cbe24f24061..0b46c6a0314 100644
--- a/src/mame/video/newport.cpp
+++ b/src/mame/video/newport.cpp
@@ -1382,8 +1382,11 @@ bool newport_video_device::pixel_clip_pass(int16_t x, int16_t y)
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;
*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
{
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
- write_pixel(x1, y1, color);
+ write_pixel(y1, x1, color);
if (e > 0)
{
@@ -1576,6 +1579,14 @@ void newport_video_device::do_iline(uint8_t color, bool skip_last, bool shade)
if (shade)
m_rex3.m_color_red += m_rex3.m_slope_red;
} 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
{
@@ -1600,15 +1611,15 @@ void newport_video_device::do_iline(uint8_t color, bool skip_last, bool shade)
if (shade)
m_rex3.m_color_red += m_rex3.m_slope_red;
} while (x1 != x2);
- }
- if (!skip_last)
- {
- if (shade)
- write_pixel(x1, y1, (uint8_t)(m_rex3.m_color_red >> 11));
- else
- write_pixel(x1, y1, color);
- }
+ if (!skip_last)
+ {
+ if (shade)
+ write_pixel(x1, y1, (uint8_t)(m_rex3.m_color_red >> 11));
+ else
+ write_pixel(x1, y1, color);
+ }
+ }
write_x_start(x1 << 11);
write_y_start(y1 << 11);
diff --git a/src/mame/video/newport.h b/src/mame/video/newport.h
index b8038c69372..65ebbaa58a4 100644
--- a/src/mame/video/newport.h
+++ b/src/mame/video/newport.h
@@ -189,7 +189,7 @@ private:
bool pixel_clip_pass(int16_t x, int16_t y);
void write_pixel(uint8_t color, bool shade);
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_h_iline(uint8_t color, bool skip_last, bool shade);